diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ImportExport.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ImportExport.tsx index aee76cfa..b05af8a8 100644 --- a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ImportExport.tsx +++ b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ImportExport.tsx @@ -64,7 +64,7 @@ export const ImportExport = () => { // INFO: WE NOT SUPPORT MIGRATIONS FOR OLD FILES AND Clipboard const parsed = parseMapUserSettings(text); - if (applySettings(applyMigrations(parsed))) { + if (applySettings(applyMigrations(parsed) || createDefaultStoredSettings())) { toast.current?.show({ severity: 'success', summary: 'Import', diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ServerSettings.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ServerSettings.tsx index d3afc80d..3d423547 100644 --- a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ServerSettings.tsx +++ b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/ServerSettings.tsx @@ -35,7 +35,7 @@ export const ServerSettings = () => { try { //INFO: INSTEAD CHECK WE WILL TRY TO APPLY MIGRATION - applySettings(applyMigrations(JSON.parse(res.default_settings))); + applySettings(applyMigrations(JSON.parse(res.default_settings)) || createDefaultStoredSettings()); callToastSuccess(toast.current, 'Settings synchronized successfully'); } catch (error) { applySettings(createDefaultStoredSettings()); diff --git a/assets/js/hooks/Mapper/mapRootProvider/hooks/useActualizeRemoteMapSettings.ts b/assets/js/hooks/Mapper/mapRootProvider/hooks/useActualizeRemoteMapSettings.ts index c786de1d..8e31b196 100644 --- a/assets/js/hooks/Mapper/mapRootProvider/hooks/useActualizeRemoteMapSettings.ts +++ b/assets/js/hooks/Mapper/mapRootProvider/hooks/useActualizeRemoteMapSettings.ts @@ -42,7 +42,7 @@ export const useActualizeRemoteMapSettings = ({ } try { - applySettings(applyMigrations(JSON.parse(res.default_settings))); + applySettings(applyMigrations(JSON.parse(res.default_settings) || createDefaultStoredSettings())); } catch (error) { applySettings(createDefaultStoredSettings()); } diff --git a/assets/js/hooks/Mapper/mapRootProvider/migrations/applyMigrations.ts b/assets/js/hooks/Mapper/mapRootProvider/migrations/applyMigrations.ts index ec9cb7cb..a6c3d604 100644 --- a/assets/js/hooks/Mapper/mapRootProvider/migrations/applyMigrations.ts +++ b/assets/js/hooks/Mapper/mapRootProvider/migrations/applyMigrations.ts @@ -26,7 +26,7 @@ export const applyMigrations = (mapSettings: any) => { return { ...currentMapSettings, version: STORED_SETTINGS_VERSION, migratedFromOld: true }; } - return; + return currentMapSettings; } const cmVersion = currentMapSettings.version || 0;