From 17330ed621dc746b49ffd4a14e8dc45e078512e4 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 19 Feb 2018 20:15:24 -0800 Subject: [PATCH] fix safari --- routes/_store/store.js | 11 ++++++----- templates/main.js | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/routes/_store/store.js b/routes/_store/store.js index 2fd1453..ad65b42 100644 --- a/routes/_store/store.js +++ b/routes/_store/store.js @@ -22,7 +22,7 @@ class PinaforeStore extends LocalStorageStore { } } -const store = new PinaforeStore({ +export const store = new PinaforeStore({ instanceNameInSearch: '', queryInSearch: '', currentInstance: null, @@ -41,10 +41,11 @@ const store = new PinaforeStore({ mixins(PinaforeStore) computations(store) -observers(store) + +export function initStore() { + observers(store) +} if (process.browser && process.env.NODE_ENV !== 'production') { window.store = store // for debugging -} - -export { store } +} \ No newline at end of file diff --git a/templates/main.js b/templates/main.js index a745c0d..111593a 100644 --- a/templates/main.js +++ b/templates/main.js @@ -1,4 +1,5 @@ import { init } from 'sapper/runtime.js' +import { initStore } from '../routes/_store/store' import { loadPolyfills } from '../routes/_utils/loadPolyfills' import '../routes/_utils/offlineNotification' import '../routes/_utils/serviceWorkerClient' @@ -7,5 +8,6 @@ import '../routes/_utils/loadingMask' loadPolyfills().then(() => { // `routes` is an array of route objects injected by Sapper + initStore() init(document.querySelector('#sapper'), __routes__) })