MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / needsMigration

Function needsMigration

src/store/migration.ts:143–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143export function needsMigration(): boolean {
144 if (typeof window === 'undefined') return false;
145
146 const legacyData = localStorage.getItem(STORAGE_KEYS.legacy);
147 if (!legacyData) return false;
148
149 // Check if any new store already exists (migration already done)
150 const hasNewStores = [
151 STORAGE_KEYS.pointCloud,
152 STORAGE_KEYS.camera,
153 STORAGE_KEYS.ui,
154 STORAGE_KEYS.export,
155 ].some(key => localStorage.getItem(key) !== null);
156
157 return !hasNewStores;
158}
159
160export function migrateFromLegacyStore(): boolean {
161 if (migrationAttempted) return false;

Callers 1

migrateFromLegacyStoreFunction · 0.85

Calls 1

getItemMethod · 0.80

Tested by

no test coverage detected