Skip to content

Commit 5fe502d

Browse files
committed
fix: switch to imported space after ZIP import completes
The SpaceImportDialog's onImportComplete callback was ignoring the spaceId and spaceName parameters, so after importing a space from ZIP the app would only refresh the manifest but never actually switch to the imported space — leaving the user on the old space with stale data. Now properly saves current space state, updates the manifest, and switches to the newly imported space. https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
1 parent 6f2843f commit 5fe502d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/ui/src/components/App.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,13 @@ export function App() {
10891089
onClose={() => setSpaceImportDialogOpen(false)}
10901090
backend={backend}
10911091
spaces={spaceInfoList.filter((s) => s.id !== 'cept-docs').map((s) => ({ id: s.id, name: s.name }))}
1092-
onImportComplete={() => {
1093-
// Refresh space list after import
1092+
onImportComplete={(importedSpaceId, importedSpaceName) => {
1093+
// Save current space state, refresh manifest, and switch to the imported space
1094+
saveCurrentSpaceState(userSpaceId, pages, favorites, recentPages, selectedPageId, spaceName, pageContents);
10941095
void loadSpaces(backend).then((manifest) => {
10951096
setSpacesManifest(manifest);
1097+
setUserSpaceId(importedSpaceId);
1098+
void loadAndApplySpaceState(importedSpaceId, importedSpaceName);
10961099
});
10971100
}}
10981101
/>

0 commit comments

Comments
 (0)