Open benloh opened 4 years ago
Joshua notes the problem:
I’m not sure how unlock works but the problem is with users occasionally navigating away, reloading, etc. so this was intended to address the user side so that if they are navigating away without completing an edit we offer them the choice and then cancel their edit if they don’t take it. Some related issues such as a crash mid-edit aren’t addressed but we think this covers most. Long-term we think the meme model of being aware on the client is also potentially useful, as well as a chron job that just cancels any locks that have sat too long but that’s less frequent an issue I think... but yes we should create issues. …
We need to warn users before they browse away.
The approach needs to be adjusted to either use React hooks/lifecycle, a custom React package, and/or clean up listeners.
https://github.com/netcreateorg/netcreate-2018/commit/a1c292296974f40d4e8407a9b4baea4c67fbab43
https://github.com/netcreateorg/netcreate-2018/commit/f148ad618470f76286bf11feefd81ed850a27af4#comments
Also, each EdgeEditor should not be adding it's own window.onbeforeunload listener. It ought to be handled at the app level?