()
| 141 | } |
| 142 | |
| 143 | export 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 | |
| 160 | export function migrateFromLegacyStore(): boolean { |
| 161 | if (migrationAttempted) return false; |
no test coverage detected