Repository navigation
fix: system workspace loading - #7731
Merged
Merged
Conversation
shaohuzhang1
commented
Nov 6, 2026
| }) | ||
| }), | ||
| ) | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Code Review
Improvements in the new version (good):
finallyensuresworkspaceLoadingresets even on error — fixes a potential "stuck spinner" bug in the old code.- Always refreshing the list after deletion, and passing the current workspace ID to preserve selection, is more robust than only refreshing when the deleted item was selected.
Remaining issues / suggestions:
- Unhandled errors: If
deleteWorkspaceorloadWorkspaceOptionsrejects, the error propagates with no user feedback. Add.catch:return WorkspaceApi.deleteWorkspace(workspace.id) .then(...) .catch((e) => MsgError(e?.message || '删除失败')) .finally(...)
- MsgConfirm rejection noise: Clicking "cancel" typically rejects the promise, producing an unhandled rejection. Wrap it:
MsgConfirm(...).then(...).catch(() => { /* 用户取消 */ })
workspace.id as stringcast: Avoidable type assertion (as string) hides possibleundefined. Validate first:if (!workspace.id) return
- Selection loss edge case: If the API supports it, better UX is to have the backend return which workspace was auto-switched to after deletion, instead of guessing client-side. Also confirm
loadWorkspaceOptions(id)actually handles "the passed ID was just deleted" (it should fall back to the first item). - Minor: Success message before refresh is fine, but consider moving
MsgSuccessafterloadWorkspaceOptionssucceeds so toast reflects the full operation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
【【工作空间】系统管理员删除工作空间后,一直处于loading状态,刷新页面后恢复】
https://www.tapd.cn/tapd_fe/45245355/bug/detail/1145245355001078886