-
Notifications
You must be signed in to change notification settings - Fork 731
Description
Currently the active version is prevented from being removed in Settings -> Electron, but if multiple windows are open this doesn't prevent one window from removing another window's active version, causing problems.
An elegant solution here could be Web locks - create a shared lock (version:<version>
) on the version that a window is currently using, and release it when the current version is changed. Then modify the code that prevents removing an active version to check if a version is currently locked (navigator.locks.query
wrapped inside a helper function). Potential problem with this approach is navigator.locks.query
is async, and the current UI doesn't handle async state. Looks like we could probably use react-async
for the moment (with an upgrade from React v16.14 to v16.18) and then use Suspense in the future when React is upgraded to v18+.