Conversation
|
I'm currently reviewing this. Regarding DeviceGroupsDialog, I think that its logic should be decoupled from the groups store.
Moreover I would not call the loading overlay from inside the stores (example here), I think it's not flexible enough and it also couples logic with presentation, it is highly probable that views will have their own way of dealing with loading screens. Tell me what you think about this. |
The thing is, I also need to access groups of a device in parts that won't use the dialog, so I do not really understant that division of deviceGroups, because "showGroupsOfDevice" seems to me that will show the dialog? I will try instead to do something in between, having the logic in the group store and just show/not show the dialog in another store, is that ok? To be more specific, selectedDevice in my code is used just by the dialog, selected groups is used also from other parts. |
Solution proposed: now the store about groups (logic) just works with all the groups and getting groups of a device, and another store about groups dialog (presentation) works with a computed property selectedDeviceGroups which is like the one proposed, and a "setter" showDeviceGroups that works as the one proposed (set a deviceId used then by the computed property). In this way the dialog subscribes itself to the groups-dialog store selectedDevice ref. |
src/main.ts
Outdated
| if (userInfo.token) { | ||
| try { | ||
| loadingOverlay.startLoading() | ||
| await useGroupsStore().updateGroups() |
There was a problem hiding this comment.
We can make these 4 calls much faster if we execute them in parallel instead of sequentially (using Promise.all if I recall correctly)
|
Can you check that loadingOverlay.start/stop is added back again in all pages where you removed it, I think some might be missing it. I've already reviewed most of the files, once you fixed this I'll finish the review! |
It's good now! |
Again here, maybe I'm not getting the context 100%, so I'll trust you |
|
🎉 This PR is included in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.