| 283 | const BLESSED_PATHS_MIGRATION_KEY = 'blessedPathsLegacyMigrated'; |
| 284 | |
| 285 | async function migrateLegacyRecentsOnce(webContents) |
| 286 | { |
| 287 | if (store == null) return; |
| 288 | if (store.get(BLESSED_PATHS_MIGRATION_KEY)) return; |
| 289 | |
| 290 | try |
| 291 | { |
| 292 | const recentsJson = await webContents.executeJavaScript( |
| 293 | 'try { localStorage.getItem(".recent") } catch (e) { null }'); |
| 294 | |
| 295 | if (typeof recentsJson === 'string') |
| 296 | { |
| 297 | const recents = JSON.parse(recentsJson); |
| 298 | |
| 299 | if (Array.isArray(recents)) |
| 300 | { |
| 301 | for (const entry of recents) |
| 302 | { |
| 303 | if (entry != null && typeof entry.id === 'string' && |
| 304 | entry.id && fs.existsSync(entry.id)) |
| 305 | { |
| 306 | blessPath(entry.id); |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | catch (e) {} // Migration is best-effort; never block app startup. |
| 313 | |
| 314 | try { store.set(BLESSED_PATHS_MIGRATION_KEY, true); } catch (e) {} |
| 315 | } |
| 316 | let appZoom = 1; |
| 317 | // Disabled by default |
| 318 | let isGoogleFontsEnabled = store != null ? (store.get('isGoogleFontsEnabled') != null? store.get('isGoogleFontsEnabled') : false) : false; |