The app should have a single instance to access db. - BoostNote.next
From https://github.com/BoostIO/BoostNote.next/issues/67#issuecomment-568688930
Users can open multiple windows of BoostNote.next app. This behavior is not intended so it could cause several problems because there are no communication measures between the windows. I'm not sure what kind of problems could happen. But I think it is better to coerce the app to have only one instance(main window) to access db.
5 Answer:
Users can open multiple windows of BoostNote.next app. This behavior is not intended so it could cause several problems because there are no communication measures between the windows.
Is it like the app.requestSingleInstanceLock()
implemented on the old BoostNote app?
https://github.com/BoostIO/Boostnote/commit/3c0f20f364a41e651fce168224fb77820fa6d7be
@jhdcruz Yes it is. If you want to try it, please check here for more information! https://www.electronjs.org/docs/api/app#event-second-instance
To apply fix for the web version, we can implement something simple such as saving a instance counter in localStorage, when user close tab or window, the counter should be updated therefore when a new tab or window load the app, we check the counter first before connecting the app. However, I don't think JS can force tab focus so there are 4 solutions that I think we can use:
Solution | Pros | Cons |
---|---|---|
Show popup to tell users to change to their previous tab that opened the app | Easy to implement | Not very good user experience |
Close the tab when the app is already open in another tab | Very easy to implement | Bad user experience |
Show popup to tell users to change to their previous tab that opened the app then close after user click ok | Easy to implement and better user experience than 2nd solution | Still not very good user experience |
Using web worker to run in background to check if there's a tab open, if the user try to access the app in the second tab, close the first tab | Better user experience | Complex to implement |
@ZeroX-DG Good start! I think closing any tabs is too aggressive. Rather than closing the tab, we should just suspend the app.
So I think when a user opens another tab, we should suspend the app in the old screen and show a dialog
Activate App
BoostNote.next is activated in other window(or tab). Once the app is activated in this window, the one in the other window(or tab) will be suspended.
This issue is not valid anymore since we've discarded the legacy cloud storage from this app. You can open multiple tabs and windows. All data will be synced via WebSocket and server-side events.
Read next
- NewPipe Play protect - Java
- how to optimize for large sites - JavaScript docsy
- [Bug Report] <el-time-select> 设置了 :editable="false" 后,组件会自动变为 disabled 状态 - Vue element-plus
- PrestaShop Connections source / http referrer database index - PHP
- Halide How to best do fuzzy comparison for floats C++
- netdata Missing network graph for some cgroup containers - C
- Error! No file exists at output path '<path><file>.strings'. - BartyCrouch
- Mailspring Pro Annual Upgrade Issue - Mailspring