Browse Source

Fixed changelog

master
Igor Zhukov 8 years ago
parent
commit
cddccdfba3
  1. 37
      app/js/services.js
  2. 3
      gulpfile.js
  3. 2
      package.json
  4. 17
      yarn.lock

37
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) { .service('ChangelogNotifyService', function (Storage, $rootScope, $modal, $timeout, MtpApiManager, ApiUpdatesManager) {
function checkUpdate () { function checkUpdate () {
$timeout(function () { MtpApiManager.getUserID().then(function (userID) {
Storage.get('last_version').then(function (lastVersion) { if (!userID) {
if (lastVersion != Config.App.version) { return
MtpApiManager.invokeApi('help.getAppChangelog', { }
prev_app_version: lastVersion $timeout(function () {
}).then(function (updates) { Storage.get('last_version').then(function (lastVersion) {
if (updates._ == 'updates' && !updates.updates.length) { if (lastVersion != Config.App.version) {
return false MtpApiManager.invokeApi('help.getAppChangelog', {
} prev_app_version: lastVersion
ApiUpdatesManager.processUpdateMessage(updates) }, {
Storage.set({last_version: Config.App.version}) noErrorBox: true,
}) }).then(function (updates) {
} if (updates._ == 'updates' && !updates.updates.length) {
}) return false
}, 5000) }
ApiUpdatesManager.processUpdateMessage(updates)
Storage.set({last_version: Config.App.version})
})
}
})
}, 5000)
})
} }
function showChangelog (lastVersion) { function showChangelog (lastVersion) {

3
gulpfile.js

@ -202,7 +202,8 @@ gulp.task('generate-service-worker', ['build'], function (callback) {
gulp.task('add-appcache-manifest', ['build'], function () { gulp.task('add-appcache-manifest', ['build'], function () {
return gulp.src(fileGlobs) return gulp.src(fileGlobs)
.pipe($.manifest({ .pipe($.manifest({
timestamp: true, timestamp: false,
hash: true,
network: ['http://*', 'https://*', '*'], network: ['http://*', 'https://*', '*'],
filename: 'webogram.appcache', filename: 'webogram.appcache',
exclude: ['webogram.appcache', 'app.manifest'] exclude: ['webogram.appcache', 'app.manifest']

2
package.json

@ -53,7 +53,7 @@
"gulp-less": "^3.0.5", "gulp-less": "^3.0.5",
"gulp-livereload": "^3.8.1", "gulp-livereload": "^3.8.1",
"gulp-load-plugins": "^0.4.0", "gulp-load-plugins": "^0.4.0",
"gulp-manifest": "0.0.3", "gulp-manifest": "0.1.1",
"gulp-minify-css": "^0.3.12", "gulp-minify-css": "^0.3.12",
"gulp-minify-html": "^0.1.1", "gulp-minify-html": "^0.1.1",
"gulp-ng-annotate": "~0.5.2", "gulp-ng-annotate": "~0.5.2",

17
yarn.lock

@ -1411,7 +1411,7 @@ event-stream@3.3.2:
stream-combiner "~0.0.4" stream-combiner "~0.0.4"
through "~2.3.1" through "~2.3.1"
event-stream@~3.0.18, event-stream@~3.0.20: event-stream@~3.0.18:
version "3.0.20" version "3.0.20"
resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.0.20.tgz#038bbb2ea9ea90385b26fbc1854d0b539f2abea3" resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.0.20.tgz#038bbb2ea9ea90385b26fbc1854d0b539f2abea3"
dependencies: dependencies:
@ -2126,12 +2126,13 @@ gulp-load-plugins@^0.4.0:
findup-sync "~0.1.2" findup-sync "~0.1.2"
globule "~0.1.0" globule "~0.1.0"
gulp-manifest@0.0.3: gulp-manifest@0.1.1:
version "0.0.3" version "0.1.1"
resolved "https://registry.yarnpkg.com/gulp-manifest/-/gulp-manifest-0.0.3.tgz#239187c0b322c24afed952393770d427dc31d2b2" resolved "https://registry.yarnpkg.com/gulp-manifest/-/gulp-manifest-0.1.1.tgz#68a801a5a15c12f7f3f1d34082070b534df9f717"
dependencies: dependencies:
event-stream "~3.0.20"
gulp-util "~2.2.6" gulp-util "~2.2.6"
minimatch "~2.0.1"
slash "^1.0.0"
through "~2.3.4" through "~2.3.4"
gulp-minify-css@^0.3.12: gulp-minify-css@^0.3.12:
@ -3564,7 +3565,7 @@ minimatch@^1.0.0:
lru-cache "2" lru-cache "2"
sigmund "~1.0.0" sigmund "~1.0.0"
minimatch@^2.0.1: minimatch@^2.0.1, minimatch@~2.0.1:
version "2.0.10" version "2.0.10"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7"
dependencies: dependencies:
@ -4431,6 +4432,10 @@ simple-is@~0.2.0:
version "0.2.0" version "0.2.0"
resolved "https://registry.yarnpkg.com/simple-is/-/simple-is-0.2.0.tgz#2abb75aade39deb5cc815ce10e6191164850baf0" 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: slice-ansi@0.0.4:
version "0.0.4" version "0.0.4"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"

Loading…
Cancel
Save