Skip to content

Commit

Permalink
feat: added showing changelog dialog when using newer version for the…
Browse files Browse the repository at this point in the history
… first time
  • Loading branch information
Endebert committed Oct 17, 2018
1 parent 29d0cce commit 92b7a14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"raf": "^3.4.0",
"raven-js": "^3.25.2",
"replace": "^1.0.0",
"semver": "^5.6.0",
"standard-version": "^4.4.0",
"typeface-roboto": "^0.0.54",
"vue": "^2.5.16",
Expand Down
12 changes: 12 additions & 0 deletions src/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ import {
VToolbar,
} from "vuetify";
import Raven from "raven-js";
import semver from "semver";
import githubIcon from "./assets/svg/github.svg";
Expand Down Expand Up @@ -716,6 +717,7 @@ export default {
selectedMap: this.fromStorage("selectedMap", undefined), // selected map in top selector
delayCalcUpdate: this.fromStorage("delayCalcUpdate", "true") === "true",
hideLoadingBar: this.fromStorage("hideLoadingBar", "true") === "true",
storedVersion: this.fromStorage("version", "v0.0.0"),
mouseKeypad: "LOL", // keypad shown in bottom left corner
showKeypadTimeout: undefined, // value of timeout, set when mouse is moved, set undefined after 1 sec
calcTimeout: undefined, // value of timeout for delayed calculations set, see calcMortar()
Expand Down Expand Up @@ -857,6 +859,16 @@ export default {
this.map.invalidateSize();
if (executions === 0) { clearInterval(interval); }
}, 250);
if (semver.gt(pkgVersion, this.storedVersion)) {
// if first view of new version
// open changelog
this.changelogDialog = true;
// put new version into localstorage
this.toStorage("version", pkgVersion);
}
},
methods: {
/**
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6505,6 +6505,10 @@ selfsigned@^1.9.1:
version "5.5.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"

semver@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"

[email protected]:
version "0.16.2"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
Expand Down

0 comments on commit 92b7a14

Please sign in to comment.