Compare commits

..

4 Commits

Author SHA1 Message Date
Book Pauk
3390676847 Merge branch 'release/0.7.4b' 2019-10-21 20:13:10 +07:00
Book Pauk
544a995312 Поправки багов синхронизации 2019-10-21 20:07:42 +07:00
Book Pauk
f209d49bb5 Поправил настройки кеширования 2019-10-21 13:07:16 +07:00
Book Pauk
42ed691fdc Merge tag '0.7.4' into develop
0.7.4
2019-10-21 12:10:45 +07:00
3 changed files with 18 additions and 25 deletions

View File

@@ -327,7 +327,6 @@ class Reader extends Vue {
(async() => { (async() => {
await bookManager.init(this.settings); await bookManager.init(this.settings);
bookManager.addEventListener(this.bookManagerEvent); bookManager.addEventListener(this.bookManagerEvent);
await this.$refs.serverStorage.init();
if (this.$root.rootRoute == '/reader') { if (this.$root.rootRoute == '/reader') {
if (this.routeParamUrl) { if (this.routeParamUrl) {
@@ -337,6 +336,7 @@ class Reader extends Vue {
} }
} }
await this.$refs.serverStorage.init();
this.checkSetStorageAccessKey(); this.checkSetStorageAccessKey();
this.checkActivateDonateHelpPage(); this.checkActivateDonateHelpPage();
this.loading = false; this.loading = false;
@@ -510,7 +510,7 @@ class Reader extends Vue {
this.debouncedUpdateRoute(); this.debouncedUpdateRoute();
} }
async bookManagerEvent(eventName) { async bookManagerEvent(eventName, value) {
if (eventName == 'set-recent' || eventName == 'recent-deleted') { if (eventName == 'set-recent' || eventName == 'recent-deleted') {
const oldBook = (this.textPage ? this.textPage.lastBook : null); const oldBook = (this.textPage ? this.textPage.lastBook : null);
const oldPos = (this.textPage ? this.textPage.bookPos : null); const oldPos = (this.textPage ? this.textPage.bookPos : null);
@@ -539,6 +539,13 @@ class Reader extends Vue {
if (this.recentBooksActive) { if (this.recentBooksActive) {
await this.$refs.recentBooksPage.updateTableData(); await this.$refs.recentBooksPage.updateTableData();
} }
if (value) {
await utils.sleep(500);
while (!this.$refs.serverStorage.inited) await utils.sleep(100);
this.$refs.serverStorage.saveRecent(value);
}
} }
} }

View File

@@ -49,10 +49,6 @@ class ServerStorage extends Vue {
this.saveSettings(); this.saveSettings();
}, 500); }, 500);
this.debouncedSaveRecent = _.debounce((itemKey) => {
this.saveRecent(itemKey);
}, 1000);
this.debouncedNotifySuccess = _.debounce(() => { this.debouncedNotifySuccess = _.debounce(() => {
this.success('Данные синхронизированы с сервером'); this.success('Данные синхронизированы с сервером');
}, 1000); }, 1000);
@@ -81,8 +77,6 @@ class ServerStorage extends Vue {
} else { } else {
await this.serverStorageKeyChanged(); await this.serverStorageKeyChanged();
} }
bookManager.addEventListener(this.bookManagerEvent);
} finally { } finally {
this.inited = true; this.inited = true;
} }
@@ -103,17 +97,6 @@ class ServerStorage extends Vue {
this.cachedRecentMod = value; this.cachedRecentMod = value;
} }
async bookManagerEvent(eventName, itemKey) {
if (!this.serverSyncEnabled)
return;
if (eventName == 'recent-changed') {
if (itemKey) {
this.debouncedSaveRecent(itemKey);
}
}
}
async generateNewServerStorageKey() { async generateNewServerStorageKey() {
const key = utils.toBase58(utils.randomArray(32)); const key = utils.toBase58(utils.randomArray(32));
this.commit('reader/setServerStorageKey', key); this.commit('reader/setServerStorageKey', key);

View File

@@ -18,14 +18,17 @@ server {
proxy_pass http://localhost:44081; proxy_pass http://localhost:44081;
} }
location /tmp { location / {
root /home/liberama/public; root /home/liberama/public;
location /tmp {
add_header Content-Type text/xml; add_header Content-Type text/xml;
add_header Content-Encoding gzip; add_header Content-Encoding gzip;
} }
location / { location ~* \.(?:manifest|appcache|html)$ {
root /home/liberama/public; expires -1;
}
} }
} }