Skip to content

Commit cac8434

Browse files
committed
INT-741 🎉 persisting last known version to localstorage
This is for future updates that want to know what version the user has used before. E.g. feature tour only shows new features, internal data structure schemas might change and need migration, etc.
1 parent fc7b5d9 commit cac8434

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ app.extend({
259259
*
260260
* @param {String} id - A key in `FEATURES`.
261261
* @param {Boolean} bool - whether to enable (true) or disable (false)
262-
* @return {Boolean}
263262
*/
264263
setFeature: function(id, bool) {
265264
FEATURES[id] = bool;

src/home/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ var HomeView = View.extend({
5151
},
5252
render: function() {
5353
this.renderWithTemplate(this);
54-
if (_.isUndefined(localStorage.tourHasRun)) {
54+
if (_.isUndefined(localStorage.lastKnownVersion)
55+
|| localStorage.lastKnownVersion !== app.meta['App Version']) {
5556
this.renderSubview(new TourView(), this.queryByHook('tour-container'));
56-
localStorage.tourHasRun = 'true';
57+
localStorage.lastKnownVersion = app.meta['App Version'];
5758
}
5859
},
5960
onInstanceFetched: function() {

0 commit comments

Comments
 (0)