summaryrefslogtreecommitdiff
path: root/src/web/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-03 07:32:18 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-03 07:32:18 +0900
commit6ba1035b69e8a3c4413d343b893ea6d9254e951f (patch)
tree310582e5dad44d50ddc3bc3c7cb1d6f9fdfafe51 /src/web/app/common
parent:v: (diff)
downloadsharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.gz
sharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.bz2
sharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.zip
nanka iroiro
Closes #1168, #1169
Diffstat (limited to 'src/web/app/common')
-rw-r--r--src/web/app/common/scripts/check-for-update.ts10
-rw-r--r--src/web/app/common/views/components/switch.vue6
2 files changed, 11 insertions, 5 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts
index 3e7eb79d8b..81c1eb9812 100644
--- a/src/web/app/common/scripts/check-for-update.ts
+++ b/src/web/app/common/scripts/check-for-update.ts
@@ -1,11 +1,13 @@
import MiOS from '../mios';
-import { version } from '../../config';
+import { version as current } from '../../config';
export default async function(mios: MiOS, force = false, silent = false) {
const meta = await mios.getMeta(force);
+ const newer = meta.version;
- if (meta.version != version) {
+ if (newer != current) {
localStorage.setItem('should-refresh', 'true');
+ localStorage.setItem('v', newer);
// Clear cache (serive worker)
try {
@@ -21,10 +23,10 @@ export default async function(mios: MiOS, force = false, silent = false) {
}
if (!silent) {
- alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', version));
+ alert('%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current));
}
- return meta.version;
+ return newer;
} else {
return null;
}
diff --git a/src/web/app/common/views/components/switch.vue b/src/web/app/common/views/components/switch.vue
index fc12e00540..bfb951dfa1 100644
--- a/src/web/app/common/views/components/switch.vue
+++ b/src/web/app/common/views/components/switch.vue
@@ -86,6 +86,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
.mk-switch
display flex
+ margin 8px 0
cursor pointer
transition all 0.3s
@@ -134,7 +135,9 @@ export default Vue.extend({
display inline-block
margin 0
width 40px
+ min-width 40px
height 20px
+ min-height 20px
background #dcdfe6
border 1px solid #dcdfe6
outline none
@@ -154,17 +157,18 @@ export default Vue.extend({
> .label
margin-left 8px
display block
- font-size 14px
cursor pointer
transition inherit
> span
+ display block
line-height 20px
color #4a535a
transition inherit
> p
margin 0
+ font-size 90%
color #9daab3
</style>