Skip to content

Commit

Permalink
* do not remember last used list for readonly users (GH-47)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpozdeev committed Nov 5, 2022
1 parent a91aaa0 commit 37e6f30
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/content/mytinytodo.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
}
else {
const lastOpenList = getLocalStorageItem('lastList');
if (lastOpenList) {
if (lastOpenList && !flag.readOnly) {
list = res.list.find( item => !item.hidden && lastOpenList == item.id );
}
if (!list) {
Expand Down Expand Up @@ -1551,7 +1551,9 @@ function tabSelect(elementOrId)
var newTitle = curList.name + ' - ' + _mtt.options.title;
var isFirstLoad = flag.firstLoad;
updateHistoryState( { list:id }, _mtt.urlForList(curList), newTitle );
setLocalStorageItem('lastList', ''+id);
if (!flag.readOnly) {
setLocalStorageItem('lastList', ''+id);
}

if (curList.hidden && flag.readOnly != true) {
curList.hidden = false;
Expand Down Expand Up @@ -2643,6 +2645,7 @@ function doAuth(form)
if(json.logged)
{
flag.isLogged = true;
window.location.hash = '';
window.location.reload();
}
else {
Expand Down

0 comments on commit 37e6f30

Please sign in to comment.