Добавил настройку отображения уведомлений от синхронизатора

This commit is contained in:
Book Pauk
2019-03-18 17:03:28 +07:00
parent ae4081001c
commit d520e13c88
3 changed files with 26 additions and 3 deletions

View File

@@ -110,6 +110,10 @@ class ServerStorage extends Vue {
return this.$store.state.reader.currentProfile;
}
get showServerStorageMessages() {
return this.settings.showServerStorageMessages;
}
checkCurrentProfile() {
if (!this.profiles[this.currentProfile]) {
this.commit('reader/setCurrentProfile', '');
@@ -118,15 +122,22 @@ class ServerStorage extends Vue {
notifySuccessIfNeeded(rev1, rev2) {
if (rev1 != rev2)
this.$notify.success({message: 'Данные синхронизированы с сервером'});
this.success('Данные синхронизированы с сервером');
}
success(message) {
if (this.showServerStorageMessages)
this.$notify.success({message});
}
warning(message) {
this.$notify.warning({message});
if (this.showServerStorageMessages)
this.$notify.warning({message});
}
error(message) {
this.$notify.error({message});
if (this.showServerStorageMessages)
this.$notify.error({message});
}
async loadSettings() {

View File

@@ -388,6 +388,7 @@
<el-form-item label="Управление">
<el-checkbox v-model="clickControl">Включить управление кликом</el-checkbox>
</el-form-item>
<el-form-item label="Подсказка">
<el-tooltip :open-delay="500" effect="light">
<template slot="content">
@@ -405,6 +406,16 @@
<el-checkbox v-model="blinkCachedLoad">Предупреждать о загрузке из кэша</el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="Подсказка">
<el-tooltip :open-delay="500" effect="light">
<template slot="content">
Показывать уведомления и ошибки от<br>
синхронизатора данных с сервером
</template>
<el-checkbox v-model="showServerStorageMessages">Показывать сообщения синхронизации</el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="URL">
<el-tooltip :open-delay="500" effect="light">
<template slot="content">

View File

@@ -165,6 +165,7 @@ const settingDefaults = {
showInlineImagesInCenter: true,
imageHeightLines: 100,
imageFitWidth: true,
showServerStorageMessages: true,
fontShifts: {},
};