add service worker

This commit is contained in:
MaysWind
2021-02-28 20:37:53 +08:00
parent 7f47ffe6c2
commit f34471839c
7 changed files with 419 additions and 24 deletions
+4
View File
@@ -56,6 +56,10 @@ export default {
pushStateAnimate: false,
iosSwipeBackAnimateShadow: false,
mdSwipeBackAnimateShadow: false
},
serviceWorker: {
path: self.$settings.isProduction() ? './sw.js' : undefined,
scope: '/',
}
}
}
+1
View File
@@ -125,6 +125,7 @@ function clearSettings() {
}
export default {
isProduction: () => process.env.NODE_ENV === 'production',
getLanguage: () => getOriginalOption('lang'),
setLanguage: value => setOption('lang', value),
isEnableDebug: () => getOption('debug'),
+2 -1
View File
@@ -1,6 +1,7 @@
import datetimeConstants from "../consts/datetime.js";
import statisticsConstants from "../consts/statistics.js";
import userState from "../lib/userstate.js";
import settings from "../lib/settings.js";
import utils from "../lib/utils.js";
import {
@@ -150,7 +151,7 @@ import {
} from './transactionTag.js';
const stores = {
strict: process.env.NODE_ENV !== 'production',
strict: !settings.isProduction(),
state: {
currentUserInfo: userState.getUserInfo(),
latestExchangeRates: getExchangeRatesFromLocalStorage(),