forked from MapComplete/MapComplete
Fix loading of the hash of a custom theme, even if the custom theme is not loaded via the URL. Fixes 352
This commit is contained in:
parent
9a73ae4c47
commit
6c3b8b2020
2 changed files with 5 additions and 7 deletions
|
@ -215,7 +215,7 @@ export class InitUiElements {
|
|||
|
||||
}
|
||||
|
||||
static LoadLayoutFromHash(userLayoutParam: UIEventSource<string>) {
|
||||
static LoadLayoutFromHash(userLayoutParam: UIEventSource<string>): [LayoutConfig, string]{
|
||||
try {
|
||||
let hash = location.hash.substr(1);
|
||||
const layoutFromBase64 = userLayoutParam.data;
|
||||
|
@ -247,7 +247,7 @@ export class InitUiElements {
|
|||
// @ts-ignore
|
||||
const layoutToUse = new LayoutConfig(json, false);
|
||||
userLayoutParam.setData(layoutToUse.id);
|
||||
return layoutToUse;
|
||||
return [layoutToUse, btoa(Utils.MinifyJSON(JSON.stringify(json)))];
|
||||
} catch (e) {
|
||||
|
||||
new FixedUiElement("Error: could not parse the custom layout:<br/> " + e).AttachTo("centermessage");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue