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

[multi-device] UI for accepting pairing request on Primary devices #433

Merged
merged 2 commits into from Aug 26, 2019

Conversation

sachaaaaa
Copy link

This PR adds the UI modals that appear when clicking on the "Pair new Device" item in the menu.
There are 3 steps:

  • Waiting for request to come through
  • Request received, requires user to discard or accept the request based on the secondary pub key
  • Message sent/error. User can only click OK. If there was an error, the user should start over.

Again, events are handled via Whisper.events to allow decoupling.
TODO: replace hard-coded strings with i18n translation thingy (in another PR)

Screen Shot 2019-08-16 at 5 14 05 pm

Screen Shot 2019-08-16 at 5 14 42 pm

Screen Shot 2019-08-16 at 5 15 05 pm

Screen Shot 2019-08-16 at 5 15 19 pm

@@ -196,5 +196,15 @@
const dialog = new Whisper.SeedDialogView({ seed });
this.el.append(dialog.el);
},
showDevicePairingDialog() {
const dialog = new Whisper.DevicePairingDialogView();
Whisper.events.on('devicePairingRequestReceived', pubKey =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to unregister these events after the dialog is closed? And would we be duplicating events if the dialog is opened multiple times?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would create multiple events. We should removeListener when dialog is closed or before we add the listener.

@sachaaaaa sachaaaaa merged commit 24cf1ef into oxen-io:multi-device Aug 26, 2019
@sachaaaaa sachaaaaa deleted the primary_accept_request branch August 26, 2019 06:50
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

Successfully merging this pull request may close these issues.

None yet

3 participants