Save layoutconfigJSON as preferences, the are saved in the morescreen

This commit is contained in:
Pieter Vander Vennet 2022-02-14 15:41:14 +01:00
parent c874afc745
commit 6cb5803efd
6 changed files with 44 additions and 10 deletions

View file

@ -72,7 +72,7 @@ export default class DetermineLayout {
public static LoadLayoutFromHash(
userLayoutParam: UIEventSource<string>
): LayoutConfig | null {
): (LayoutConfig & {definition: LayoutConfigJson}) | null {
let hash = location.hash.substr(1);
let json: any;
@ -113,7 +113,9 @@ export default class DetermineLayout {
const layoutToUse = DetermineLayout.prepCustomTheme(json)
userLayoutParam.setData(layoutToUse.id);
return new LayoutConfig(layoutToUse, false);
const config = new LayoutConfig(layoutToUse, false);
config["definition"] = json
return <any> config
} catch (e) {
console.error(e)
if (hash === undefined || hash.length < 10) {

View file

@ -68,7 +68,8 @@ export default class UserRelatedState extends ElementsState {
id: this.layoutToUse.id,
icon: this.layoutToUse.icon,
title: this.layoutToUse.title.translations,
shortDescription: this.layoutToUse.shortDescription.translations
shortDescription: this.layoutToUse.shortDescription.translations,
definition: this.layoutToUse["definition"]
}))
}