build: v1.5.1; feat: added basic confirmation prompt when resetting settings to default (closes #16); feat: added toast when resetting settings to default

This commit is contained in:
Roberto Tonino 2020-11-28 19:08:01 +01:00
parent 04554b60d7
commit 919498f31c
5 changed files with 22 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{
"name": "deemix-webui",
"version": "1.5.0",
"version": "1.5.1",
"scripts": {
"clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map",
"clean-temp": "rimraf public/js/bundle.temp.js",

File diff suppressed because one or more lines are too long

View file

@ -46,13 +46,14 @@
</button>
</div>
<RouterLink :to="{ name: 'ARL' }">
<RouterLink :to="{ name: 'ARL' }" class="block">
{{ $t('settings.login.arl.question') }}
</RouterLink>
<a v-if="clientMode" href="#" @click="appLogin">
<a v-if="clientMode" href="#" class="block" @click="appLogin">
{{ $t('settings.login.login') }}
</a>
<button class="btn btn-primary" @click="login" style="width: 100%">
{{ $t('settings.login.arl.update') }}
</button>
@ -651,7 +652,7 @@
</BaseAccordion>
<footer class="bg-background-main">
<button class="mr-2 btn btn-primary" @click="resetSettings">{{ $t('settings.reset') }}</button>
<button class="mr-2 btn btn-primary" @click="resetToDefault">{{ $t('settings.reset') }}</button>
<button class="btn btn-primary" @click="saveSettings">{{ $t('settings.save') }}</button>
</footer>
</div>
@ -967,8 +968,13 @@ export default {
toast(this.$t('settings.toasts.update'), 'settings')
},
resetSettings() {
resetToDefault() {
const wantsToReset = confirm(this.$t('settings.resetMessage'))
if (!wantsToReset) return
this.settings = JSON.parse(JSON.stringify(this.defaultSettings))
toast(this.$t('settings.toasts.reset'), 'settings')
}
}
}

View file

@ -376,10 +376,12 @@ const en = {
question: 'How do I enable Spotify Features?'
},
reset: 'Reset to Default',
resetMessage: 'Are you sure you want to go back to default settings?',
save: 'Save',
toasts: {
init: 'Settings loaded!',
update: 'Settings updated!',
reset: 'Settings reset to default!',
ARLcopied: 'ARL copied to clipboard'
}
},

View file

@ -379,10 +379,12 @@ const it = {
question: 'Come attivo le Spotify Features?'
},
reset: 'Reimposta Default',
resetMessage: 'Sei sicuro di voler tornare alle impostazioni di default?',
save: 'Salva',
toasts: {
init: 'Impostazioni caricate!',
update: 'Impostazioni aggiornate!',
reset: 'Impostazioni di default ripristinate!',
ARLcopied: 'ARL copiato negli appunti'
}
},