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

Add warning on tab close #102

Merged
merged 7 commits into from
Dec 19, 2022
Merged

Add warning on tab close #102

merged 7 commits into from
Dec 19, 2022

Conversation

JustusFT
Copy link
Contributor

@JustusFT JustusFT commented Dec 6, 2022

Ref: #80

When the user tries to navigate away during a transfer, they will be prompted with a warning that the transfer will cancel. Note that newer browser versions will not show the custom error message but instead a generic warning. See this for more information: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#compatibility_notes

Closing the tab or clicking a link will trigger the warning on the following screens:

  • ReceiveConsentScreen
  • ReceiveProgressScreen
  • SendInstructionsScreen
  • SendProgressScreen

@JustusFT JustusFT requested a review from donpui December 6, 2022 23:46
@JustusFT JustusFT changed the title Warn tab close Add warning on tab close Dec 6, 2022
@JustusFT
Copy link
Contributor Author

JustusFT commented Dec 6, 2022

Also, maybe we should do something about this link to the terms in ReceiveConsentScreen, such as having it open in a new tab or in a modal to prevent the warning from happening.

Screen Shot 2022-12-07 at 07 53 44

Also, a better solution later on could be that the user is allowed to view other pages during a transfer, and have a way to return to the ongoing transfer screen

@donpui
Copy link
Contributor

donpui commented Dec 12, 2022

Also, a better solution later on could be that the user is allowed to view other pages during a transfer, and have a way to return to the ongoing transfer screen

This would be nice thing. Probably we will need this when we will have dilation and multiple file transfer sending.

@donpui
Copy link
Contributor

donpui commented Dec 12, 2022

Also, maybe we should do something about this link to the terms in ReceiveConsentScreen, such as having it open in a new tab or in a modal to prevent the warning from happening.

Probably this is the case, where we need to force user open in new tab.

@donpui
Copy link
Contributor

donpui commented Dec 12, 2022

FYI: On iOS Safari/Chrome this doesn't work.. however with Android Chrome it works.

@donpui
Copy link
Contributor

donpui commented Dec 12, 2022

Copy link button doesn't work for me. @JustusFT can you verify on your side?

@donpui
Copy link
Contributor

donpui commented Dec 12, 2022

Desktop Chrome/Firefox/Safari are working

Copy link
Contributor

@donpui donpui left a comment

Choose a reason for hiding this comment

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

Check Copy link. Also Terms link make _blank to open in new tab.

@JustusFT
Copy link
Contributor Author

@donpui Looks like the mobile clipboard issue was present for a while. I made a separate PR for the fix: #112

@JustusFT JustusFT requested a review from donpui December 19, 2022 07:11
@donpui
Copy link
Contributor

donpui commented Dec 19, 2022

@donpui Looks like the mobile clipboard issue was present for a while. I made a separate PR for the fix: #112

This helped, thanks

@JustusFT JustusFT requested a review from donpui December 19, 2022 10:40
Copy link
Contributor

@donpui donpui left a comment

Choose a reason for hiding this comment

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

Seems ok

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.

2 participants