mirror of
https://github.com/mue/mue.git
synced 2026-07-17 22:14:13 +02:00
feat(install): improve photo pack installation logic to prevent immediate background refresh
This commit is contained in:
@@ -29,6 +29,7 @@ export function install(type, input, sideload, collection) {
|
||||
|
||||
case 'photos': {
|
||||
const currentPhotos = JSON.parse(localStorage.getItem('photo_packs')) || [];
|
||||
const hadPhotoPacks = currentPhotos.length > 0;
|
||||
input.photos.forEach((photo) => {
|
||||
currentPhotos.push(photo);
|
||||
});
|
||||
@@ -41,8 +42,11 @@ export function install(type, input, sideload, collection) {
|
||||
localStorage.removeItem('backgroundchange');
|
||||
// Clear image queue to ensure fresh background loads
|
||||
clearQueuesOnSettingChange('packInstall');
|
||||
// Set refresh event to emit after installed data is saved
|
||||
refreshEvent = 'backgroundrefresh';
|
||||
// Only refresh background if this is the first photo pack being installed
|
||||
// Otherwise just update the queue without jarring the user with an immediate refresh
|
||||
if (!hadPhotoPacks) {
|
||||
refreshEvent = 'backgroundrefresh';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user