Skip to content

Commit 55a57e3

Browse files
committed
fix(state): use primarySelection when restoring view data
1 parent d349c87 commit 55a57e3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/io/import/processors/restoreStateFile.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ export async function completeStateFileRestore(
127127
});
128128

129129
if (!manifest.viewByID) {
130-
const firstStoreID = Object.values(stateIDToStoreID)[0];
131-
if (firstStoreID) {
132-
viewStore.setDataForAllViews(firstStoreID);
130+
const storeID = manifest.primarySelection
131+
? stateIDToStoreID[manifest.primarySelection]
132+
: Object.values(stateIDToStoreID)[0];
133+
if (storeID) {
134+
viewStore.setDataForAllViews(storeID);
133135
}
134136
}
135137

0 commit comments

Comments
 (0)