diff --git a/labscore/cardstack/stack.js b/labscore/cardstack/stack.js index cbb1142..a1fb1bb 100644 --- a/labscore/cardstack/stack.js +++ b/labscore/cardstack/stack.js @@ -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.