Skip to content

Commit 4f0f410

Browse files
refactor: address pr comments.
1 parent 3adeebd commit 4f0f410

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/modules/app-core/workspace-sync-controller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ const createWorkspaceSyncController = ({
4444
return false
4545
}
4646

47-
const removedPath =
48-
getTabTargetPrFilePath(tab) || normalizeWorkspacePathValue(tab?.path) || ''
47+
const removedPath = normalizeWorkspacePathValue(
48+
getTabTargetPrFilePath(tab) || tab?.path,
49+
)
4950
if (!removedPath) {
5051
return false
5152
}

src/modules/app-core/workspace-tab-mutations-controller.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,15 @@ const createWorkspaceTabMutationsController = ({
215215
onConfirm: () => {
216216
const removedKind = isStyleWorkspaceTab(tab) ? 'styles' : 'component'
217217
persistActiveTabEditorContent()
218-
if (typeof trackRemovedWorkspaceTab === 'function') {
219-
trackRemovedWorkspaceTab(tab)
220-
}
221218
const removed = workspaceTabsState.removeTab(tab.id)
222219
if (!removed) {
223220
return
224221
}
225222

223+
if (typeof trackRemovedWorkspaceTab === 'function') {
224+
trackRemovedWorkspaceTab(tab)
225+
}
226+
226227
if (typeof clearTrackedWorkspaceTab === 'function') {
227228
clearTrackedWorkspaceTab(tab.id)
228229
}

0 commit comments

Comments
 (0)