fix invalid page state resolving

This commit is contained in:
bignutty 2025-03-15 17:33:43 +01:00
parent 2a9eca457a
commit 27cc17cd4a

View file

@ -302,11 +302,20 @@ class DynamicCardStack {
* @param {String} key
*/
getState(key) {
if (!this.pageState[this.rootIndex]) return null;
if (!this.pageState[this.rootIndex][key]) return null;
if (typeof(this.pageState[this.rootIndex]) == "undefined") return null;
if (typeof(this.pageState[this.rootIndex][key]) == "undefined") return null;
return this.pageState[this.rootIndex][key];
}
/**
* Returns all page state.
* Only really intended for debugging purposes.
* @returns {Object}
*/
getAllCurrentState() {
return this.pageState[this.rootIndex];
}
/**
* Returns all page state.
* Only really intended for debugging purposes.