Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
Fixes deleting tracked user (now it disables tracking)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpukhanov committed Feb 26, 2018
1 parent 8dcb8ea commit 8a280bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,16 @@ function shiftDownUser() {

function deleteUser() {
var userId = $(this).data('user-id');
var specialChange;

if (_options.trackedUser && areUsersEqual(_options.trackedUser, _options.users[userId])) {
// If tracked user is removed, disable tracking
_options.trackedUser = null;
specialChange = 'changeTracked';
}

_options.users.splice(userId, 1);
saveOptions();
saveOptions(specialChange);
}

function saveModalUser() {
Expand Down

0 comments on commit 8a280bf

Please sign in to comment.