-
Notifications
You must be signed in to change notification settings - Fork 195
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
Refactor Delete Profile Modal by separating it from Profiles.vue #1325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This on right track.
0cc9d69
to
3737e7d
Compare
- `DeleteProfileModal` has been separated from `Profiles.vue` - `profileList` has been added to Vuex storage
3737e7d
to
d8074d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall things are starting to look good. Use your own judgement on the comments marked as minor or nitpick. I'd like the rest of the comments addressed, i.e. changed or argumented why the suggested change is not a good idea.
658b20c
to
7889a82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on the requested changes, but some new things emerged as a result.
…asynchronous - Changes have been made to `updateProfileList()` function. - End results have not been changed, only getting there has been improved.
7889a82
to
99cbcba
Compare
6ec0a39
to
5794d5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes themselves passed my review, but I did some manual testing and detected a bug. It's actually a regression since I broke the same thing when implementing the "cache prewarming" a while back. Anyway, it should be easy to fix (but do test it yourself since I didn't.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug still remains in one special case.
src/store/modules/ProfilesModule.ts
Outdated
throw R2Error.fromThrownValue(e, 'Error whilst deleting profile from disk'); | ||
} | ||
|
||
if (profileName.toLowerCase() !== 'default') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Default
profile is "deleted", new empty Default
profile should be created instantly - and it does. However, when that profile is selected, it still shows the mods of the Default
profile that was deleted. I think this if-clause might be the culprit. Either we should always call setSelectedProfile
at the end of removeSelectedProfile
; or we could add an else-clause here that calls just profile/updateModListFromFile
and tsMods/prewarmCache
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You went a little overboard with this. Now, in addition to always calling setSelectedProfile
, you also always filter the removed profile name from the list of profiles. We don't want to do that if it was the default profile - the Default
should always be visible on the list.
(IDK if there's a good rationale to treat the default profile differently, but at least the code base assumes that there's always a profile called Default, so it's nice for UI to reflect that. And that's how it has worked so far, so maybe we shouldn't change that in this PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ok now
24b5361
to
cd8c2ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another bug crept up.
cd8c2ff
to
2faa289
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
DeleteProfileModal
has been separated fromProfiles.vue
profileList
has been added to Vuex storage