From 1b7590f499729a32ccff6a17f67d89cf8c18d198 Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Thu, 11 Aug 2022 10:43:18 +0200 Subject: [PATCH 1/2] Operations Store on Window --- javascript/operation_store.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/javascript/operation_store.js b/javascript/operation_store.js index 26fa9ee9..c8eac8eb 100644 --- a/javascript/operation_store.js +++ b/javascript/operation_store.js @@ -1,9 +1,9 @@ import Operations from './operations' -let operations = Operations +window.CableReadyOperationsStore = Operations const add = newOperations => { - operations = { ...operations, ...newOperations } + window.CableReadyOperationsStore = { ...window.CableReadyOperationsStore, ...newOperations } } const addOperations = operations => { @@ -21,6 +21,10 @@ export { addOperation, addOperations } export default { get all () { - return operations + return window.CableReadyOperationsStore + }, + + getAll() { + return window.CableReadyOperationsStore } } From a3b5e79591765de362edb30fc854d95c81513bae Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Thu, 11 Aug 2022 10:44:06 +0200 Subject: [PATCH 2/2] don't let it override --- javascript/operation_store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/operation_store.js b/javascript/operation_store.js index c8eac8eb..11342601 100644 --- a/javascript/operation_store.js +++ b/javascript/operation_store.js @@ -1,6 +1,8 @@ import Operations from './operations' -window.CableReadyOperationsStore = Operations +if (!window.CableReadyOperationsStore) { + window.CableReadyOperationsStore = Operations +} const add = newOperations => { window.CableReadyOperationsStore = { ...window.CableReadyOperationsStore, ...newOperations }