Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin url navigation iside hyper using SESSION_URL_SET action #3095

Open
2 tasks done
Pavel-Durov opened this issue Jun 20, 2018 · 0 comments
Open
2 tasks done

Plugin url navigation iside hyper using SESSION_URL_SET action #3095

Pavel-Durov opened this issue Jun 20, 2018 · 0 comments

Comments

@Pavel-Durov
Copy link
Contributor

Issue

I'm trying to implement a simple plugin, so I followed the PLUGINS.md instruction and I got stuck with the following problem:

It seems to be that current version of hyper ignores 'SESSION_ADD_DATA' actions types.
This is my very basic plugin: suppose to open a wiki page in hyper.

exports.middleware = (store) => (next) => (action) => {
	if ('SESSION_ADD_DATA' === action.type && /wiki/.test(action.data)) {
		store.dispatch({
			type: 'SESSION_URL_SET',
			uid: store.getState().sessions.activeUid,
			url: "https://en.wikipedia.org/wiki/Wiki"
		});
		console.log('navigating to wiki, activeUid', activeUid);
	} else {
		next(action);
	}
};

Other actions actually work, example:

store.dispatch({
    type: 'NOTIFICATION_MESSAGE',
    text: "Hello There!",
    url: "https://en.wikipedia.org/wiki/Wiki",
    dismissable: tru
});

I couldn't find anything regarding "SESSION_URL_SET" action.

  • Is it intentional, or is it an issue?
  • Is there any other way to accomplish url navigation:?

Recordong

jun-20-2018 22-54-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant