mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 18:22:21 +00:00
Fixes #1528. Stores the currently selected tags locally before synchronizing with the server and restores them after the new user object comes back down the pipe. One potential issue that should probably be fixed is if a tag is deleted on another client that has it selected, there is no visual feedback showing that a tag is still selected, but there are no tasks shown because a null tag is selected. This is fixed by pressing "clear filters", but null filters should probably be checked eventually
This commit is contained in:
parent
e0c2243185
commit
aa0c69e082
1 changed files with 5 additions and 0 deletions
|
|
@ -56,6 +56,9 @@ angular.module('userServices', []).
|
|||
sent.push(queue.shift());
|
||||
});
|
||||
|
||||
// Save the current filters
|
||||
var current_filters = user.filters;
|
||||
|
||||
$http.post(API_URL + '/api/v2/user/batch-update', sent, {params: {data:+new Date, _v:user._v, siteVersion: $window.env && $window.env.siteVersion}})
|
||||
.success(function (data, status, heacreatingders, config) {
|
||||
//make sure there are no pending actions to sync. If there are any it is not safe to apply model from server as we may overwrite user data.
|
||||
|
|
@ -70,6 +73,8 @@ angular.module('userServices', []).
|
|||
|
||||
// Update user
|
||||
_.extend(user, data);
|
||||
// Preserve filter selections between syncs
|
||||
_.extend(user.filters,current_filters);
|
||||
if (!user._wrapped){
|
||||
|
||||
// This wraps user with `ops`, which are functions shared both on client and mobile. When performed on client,
|
||||
|
|
|
|||
Loading…
Reference in a new issue