mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
feat: add selected background to background migration
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
import base64ToBlob from './base64ToBlob';
|
||||
import { delay } from './delay';
|
||||
import { openDatabase, writeData } from '@/interface/hooks/BackgroundDataLoader';
|
||||
import { backgroundUpdates } from '@/interface/hooks/BackgroundUpdates';
|
||||
|
||||
@@ -43,7 +42,7 @@ export const migrateBackgrounds = async (): Promise<void> => {
|
||||
|
||||
case 'BACKGROUND_DATA':
|
||||
try {
|
||||
const { id, data, mediaType, total, processed } = event.data.payload;
|
||||
const { id, data, mediaType, total, processed, isSelected } = event.data.payload;
|
||||
const mimeType = mediaType === 'image' ? 'image/png' : 'video/mp4';
|
||||
const blob = base64ToBlob(data, mimeType);
|
||||
|
||||
@@ -53,6 +52,10 @@ export const migrateBackgrounds = async (): Promise<void> => {
|
||||
type: mediaType
|
||||
});
|
||||
|
||||
if (isSelected) {
|
||||
localStorage.setItem('selectedBackground', id);
|
||||
}
|
||||
|
||||
migrationState.lastProcessedId = id;
|
||||
migrationState.total = total;
|
||||
migrationState.processed = processed;
|
||||
|
||||
Reference in New Issue
Block a user