mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
cleanup on end tour
This commit is contained in:
@@ -51,8 +51,7 @@ angular.module('guideServices', []).
|
|||||||
$('.main-herobox').popover('destroy');
|
$('.main-herobox').popover('destroy');
|
||||||
var tour = new Tour({
|
var tour = new Tour({
|
||||||
onEnd: function(){
|
onEnd: function(){
|
||||||
User.user.flags.showTour = false;
|
User.set('flags.showTour', false);
|
||||||
User.log({op:'set',data:{'flags.showTour':false}});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tourSteps.forEach(function(step) {
|
tourSteps.forEach(function(step) {
|
||||||
|
|||||||
@@ -135,38 +135,37 @@ angular.module('userServices', []).
|
|||||||
},
|
},
|
||||||
|
|
||||||
log: function (action, cb) {
|
log: function (action, cb) {
|
||||||
//push by one buy one if an array passed in.
|
//push by one buy one if an array passed in.
|
||||||
if (_.isArray(action)) {
|
if (_.isArray(action)) {
|
||||||
action.forEach(function (a) {
|
action.forEach(function (a) {
|
||||||
settings.sync.queue.push(a);
|
settings.sync.queue.push(a);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
settings.sync.queue.push(action);
|
settings.sync.queue.push(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
save();
|
save();
|
||||||
syncQueue(cb);
|
syncQueue(cb);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Very simple path-set. `set('preferences.gender','m')` for example. We'll deprecate this once we have a complete API
|
Very simple path-set. `set('preferences.gender','m')` for example. We'll deprecate this once we have a complete API
|
||||||
*/
|
*/
|
||||||
set: function(k, v) {
|
set: function(k, v) {
|
||||||
var self = userServices;
|
|
||||||
var log = { op: 'set', data: {} };
|
var log = { op: 'set', data: {} };
|
||||||
window.habitrpgShared.helpers.dotSet(k, v, userServices.user);
|
window.habitrpgShared.helpers.dotSet(k, v, this.user);
|
||||||
log.data[k] = v;
|
log.data[k] = v;
|
||||||
userServices.log(log);
|
this.log(log);
|
||||||
},
|
},
|
||||||
|
|
||||||
setMultiple: function(obj){
|
setMultiple: function(obj){
|
||||||
var self = this;
|
var self = this;
|
||||||
var log = { op: 'set', data: {} };
|
var log = { op: 'set', data: {} };
|
||||||
_.each(obj, function(v,k){
|
_.each(obj, function(v,k){
|
||||||
window.habitrpgShared.helpers.dotSet(k, v, userServices.user);
|
window.habitrpgShared.helpers.dotSet(k, v, self.user);
|
||||||
log.data[k] = v;
|
log.data[k] = v;
|
||||||
})
|
});
|
||||||
userServices.log(log);
|
self.log(log);
|
||||||
},
|
},
|
||||||
|
|
||||||
save: save,
|
save: save,
|
||||||
|
|||||||
Reference in New Issue
Block a user