From cddccdfba305c3b421e79c12b66fc772430745a1 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 30 Jun 2017 22:36:03 +0300 Subject: [PATCH] Fixed changelog --- app/js/services.js | 37 ++++++++++++++++++++++--------------- gulpfile.js | 3 ++- package.json | 2 +- yarn.lock | 17 +++++++++++------ 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index a1c676b0..3423b7d1 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -4343,21 +4343,28 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) .service('ChangelogNotifyService', function (Storage, $rootScope, $modal, $timeout, MtpApiManager, ApiUpdatesManager) { function checkUpdate () { - $timeout(function () { - Storage.get('last_version').then(function (lastVersion) { - if (lastVersion != Config.App.version) { - MtpApiManager.invokeApi('help.getAppChangelog', { - prev_app_version: lastVersion - }).then(function (updates) { - if (updates._ == 'updates' && !updates.updates.length) { - return false - } - ApiUpdatesManager.processUpdateMessage(updates) - Storage.set({last_version: Config.App.version}) - }) - } - }) - }, 5000) + MtpApiManager.getUserID().then(function (userID) { + if (!userID) { + return + } + $timeout(function () { + Storage.get('last_version').then(function (lastVersion) { + if (lastVersion != Config.App.version) { + MtpApiManager.invokeApi('help.getAppChangelog', { + prev_app_version: lastVersion + }, { + noErrorBox: true, + }).then(function (updates) { + if (updates._ == 'updates' && !updates.updates.length) { + return false + } + ApiUpdatesManager.processUpdateMessage(updates) + Storage.set({last_version: Config.App.version}) + }) + } + }) + }, 5000) + }) } function showChangelog (lastVersion) { diff --git a/gulpfile.js b/gulpfile.js index 63942b78..df40947a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -202,7 +202,8 @@ gulp.task('generate-service-worker', ['build'], function (callback) { gulp.task('add-appcache-manifest', ['build'], function () { return gulp.src(fileGlobs) .pipe($.manifest({ - timestamp: true, + timestamp: false, + hash: true, network: ['http://*', 'https://*', '*'], filename: 'webogram.appcache', exclude: ['webogram.appcache', 'app.manifest'] diff --git a/package.json b/package.json index 96d1afc5..358ea161 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "gulp-less": "^3.0.5", "gulp-livereload": "^3.8.1", "gulp-load-plugins": "^0.4.0", - "gulp-manifest": "0.0.3", + "gulp-manifest": "0.1.1", "gulp-minify-css": "^0.3.12", "gulp-minify-html": "^0.1.1", "gulp-ng-annotate": "~0.5.2", diff --git a/yarn.lock b/yarn.lock index 62845f2e..b41b42a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1411,7 +1411,7 @@ event-stream@3.3.2: stream-combiner "~0.0.4" through "~2.3.1" -event-stream@~3.0.18, event-stream@~3.0.20: +event-stream@~3.0.18: version "3.0.20" resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.0.20.tgz#038bbb2ea9ea90385b26fbc1854d0b539f2abea3" dependencies: @@ -2126,12 +2126,13 @@ gulp-load-plugins@^0.4.0: findup-sync "~0.1.2" globule "~0.1.0" -gulp-manifest@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/gulp-manifest/-/gulp-manifest-0.0.3.tgz#239187c0b322c24afed952393770d427dc31d2b2" +gulp-manifest@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/gulp-manifest/-/gulp-manifest-0.1.1.tgz#68a801a5a15c12f7f3f1d34082070b534df9f717" dependencies: - event-stream "~3.0.20" gulp-util "~2.2.6" + minimatch "~2.0.1" + slash "^1.0.0" through "~2.3.4" gulp-minify-css@^0.3.12: @@ -3564,7 +3565,7 @@ minimatch@^1.0.0: lru-cache "2" sigmund "~1.0.0" -minimatch@^2.0.1: +minimatch@^2.0.1, minimatch@~2.0.1: version "2.0.10" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" dependencies: @@ -4431,6 +4432,10 @@ simple-is@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/simple-is/-/simple-is-0.2.0.tgz#2abb75aade39deb5cc815ce10e6191164850baf0" +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"