* do not remember last used list for readonly users (GH-47)

This commit is contained in:
maxpozdeev 2022-11-05 20:06:39 +03:00
parent a91aaa09af
commit 37e6f30a57

View file

@ -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) {
@ -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;
@ -2643,6 +2645,7 @@ function doAuth(form)
if(json.logged)
{
flag.isLogged = true;
window.location.hash = '';
window.location.reload();
}
else {