mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: background migration not working properly
This commit is contained in:
@@ -40,6 +40,10 @@
|
||||
{
|
||||
"resources": ["resources/icons/*"],
|
||||
"matches": ["*://*/*"]
|
||||
},
|
||||
{
|
||||
"resources": ["seqta/utils/migration/migrate.html"],
|
||||
"matches": ["*://*/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -44,7 +44,23 @@ const getSelectedBackground = (): string | null => {
|
||||
const startMigration = async () => {
|
||||
try {
|
||||
console.info('Starting background extraction...');
|
||||
const backgrounds = await getAllBackgrounds();
|
||||
let backgrounds: Data[];
|
||||
try {
|
||||
backgrounds = await getAllBackgrounds();
|
||||
if (!backgrounds || backgrounds.length === 0) {
|
||||
console.info('No backgrounds to migrate');
|
||||
window.parent.postMessage({ type: 'MIGRATION_COMPLETE' }, '*');
|
||||
return;
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (error.name === 'NotFoundError' && error.message.includes('object stores was not found')) {
|
||||
console.info('No backgrounds to migrate: object store not found');
|
||||
window.parent.postMessage({ type: 'MIGRATION_COMPLETE' }, '*');
|
||||
return;
|
||||
}
|
||||
console.error('Error fetching backgrounds:', error);
|
||||
throw new Error('Failed to fetch backgrounds');
|
||||
}
|
||||
const selectedBackground = getSelectedBackground();
|
||||
console.info(`Found ${backgrounds.length} backgrounds`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user