Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 change itself is probably an improvement: always calling
loadChatUserGroups()after a successful delete avoids a stale list when a non-current group is deleted. The old code only refreshed the list when the deleted group was the current group.However, there are several things to check/fix:
currentGroupmay remain stalecurrentGroup, unlessloadChatUserGroups()already does that.Always reloading may be unnecessary or disruptive
loadChatUserGroups()resets selection, pagination, scroll position, or filters, deleting a non-current group may cause UI regressions.groupslist and only reload when needed. Otherwise, confirmloadChatUserGroups()preserves state.Loading state is not reset on failure
groupsLoading.value = trueis set, but there is nofinally/reset in the shown code.Errors are swallowed
.catch(() => {})hides both delete failures and reload failures. Users get no error feedback, and callers cannot detect failure.Possible brace/parenthesis issue in the pasted snippet
})before.catch(...):Double-click / concurrent delete protection
Suggested refactor:
If
loadChatUserGroups()managesgroupsLoadingitself, use a separate flag such asdeleting.valueto avoid conflicting loading states.