@ -2,6 +2,6 @@
|
||||
* Version
|
||||
*/
|
||||
|
||||
const meta = require('../package.json');
|
||||
const meta = require('../version.json');
|
||||
|
||||
export default meta.version as string;
|
||||
|
@ -61,11 +61,13 @@
|
||||
app = isMobile ? 'mobile' : 'desktop';
|
||||
}
|
||||
|
||||
const ver = localStorage.getItem('v') || VERSION;
|
||||
|
||||
// Load an app script
|
||||
// Note: 'async' make it possible to load the script asyncly.
|
||||
// 'defer' make it possible to run the script when the dom loaded.
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', `/assets/${app}.${VERSION}.${lang}.js`);
|
||||
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -94,6 +94,9 @@
|
||||
<mk-switch v-model="debug" text="デバッグモードを有効にする">
|
||||
<span>この設定はアカウントに保存されません。</span>
|
||||
</mk-switch>
|
||||
<mk-switch v-model="enableExperimental" text="実験的機能を有効にする">
|
||||
<span>この設定はアカウントに保存されません。実験的機能を有効にするとMisskeyの動作が不安定になる可能性があります。</span>
|
||||
</mk-switch>
|
||||
</section>
|
||||
|
||||
<section class="other" v-show="page == 'other'">
|
||||
@ -126,17 +129,22 @@ export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
page: 'profile',
|
||||
meta: null,
|
||||
license,
|
||||
version,
|
||||
latestVersion: undefined,
|
||||
checkingForUpdate: false,
|
||||
showPostFormOnTopOfTl: false,
|
||||
debug: localStorage.getItem('debug') == 'true'
|
||||
debug: localStorage.getItem('debug') == 'true',
|
||||
enableExperimental: localStorage.getItem('enableExperimental') == 'true'
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
debug() {
|
||||
localStorage.setItem('debug', this.debug ? 'true' : 'false');
|
||||
},
|
||||
enableExperimental() {
|
||||
localStorage.setItem('enableExperimental', this.enableExperimental ? 'true' : 'false');
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -145,6 +153,7 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.meta = (this as any).os.getMeta();
|
||||
this.showPostFormOnTopOfTl = (this as any).os.i.client_settings.showPostFormOnTopOfTl;
|
||||
},
|
||||
methods: {
|
||||
|
Reference in New Issue
Block a user