forked from MapComplete/MapComplete
Fix loading of themes in the custom generator: use compression
This commit is contained in:
parent
63187aab04
commit
d601896f79
2 changed files with 11 additions and 7 deletions
|
@ -7,7 +7,13 @@ import {LocalStorageSource} from "./Logic/Web/LocalStorageSource";
|
|||
|
||||
let layout = GenerateEmpty.createEmptyLayout();
|
||||
if (window.location.hash.length > 10) {
|
||||
layout = JSON.parse(atob(window.location.hash.substr(1))) as LayoutConfigJson;
|
||||
try{
|
||||
layout = JSON.parse(atob(window.location.hash.substr(1))) as LayoutConfigJson;
|
||||
}catch(e){
|
||||
console.log("Initial load of theme failed, attempt nr 2 with decompression", e)
|
||||
layout = JSON.parse(atob(window.location.hash.substr(1))) as LayoutConfigJson;
|
||||
}
|
||||
|
||||
} else {
|
||||
const hash = LocalStorageSource.Get("last-custom-theme").data
|
||||
if (hash !== undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue