Skip to content

Commit

Permalink
addressed the key of "last synchronized"
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolProgrammingUser committed Feb 22, 2025
1 parent 8f72eea commit d4deaed
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@
}, 0);
// randomly displays inspiring messages (if desired)
if (S.getId(advancedSettingsSection, "inspiringMessages").checked && Math.floor(Math.random() * 5) == 0) {
let messages = ["You're the best!", "You're worth it.", "Nothing can stop you.", "You rock!", "You're an amazing person.", "The world wouldn't be the same without you.", "I love you."];
let messages = ["You're the best!", "You're worth it.", "Nothing can stop you.", "You rock!", "You're an amazing person.", "The world wouldn't be the same without you."]; //, "I love you."];
S.makeDialog(messages[Math.floor(Math.random() * messages.length)], "Thank you");
}
} else {
Expand Down Expand Up @@ -1043,7 +1043,7 @@
M[storagePlace].store("/lists/" + list[index], data);
if (index + 1 >= list.length) { // once all items have been iterated through
S.forEach(M[storagePlace].list("/lists/"), function (key) {
if (!list.includes(key) && key != "start-up settings") {
if (!list.includes(key) && key != "start-up settings" && key != "last synchronized") {
recyclingBin[key] = M[storagePlace].recall("/lists/" + key); // holds on to deleted items just in case
M[storagePlace].forget("/lists/" + key);
}
Expand Down Expand Up @@ -1256,7 +1256,7 @@
// lists the lists
let listArray = [];
M[storagePlace].list("/lists/").forEach(function (location) {
if (location != "start-up settings") {
if (location != "start-up settings" && location != "last synchronized") {
let listName = location.slice(0, location.indexOf("/"));
if (!listArray.includes(listName)) {
listArray.push(listName);
Expand Down Expand Up @@ -1602,6 +1602,9 @@
if (M[storagePlace].recall("../settings/filter") instanceof Error) {
M[storagePlace].store("../settings/filter", []);
}
if (M[storagePlace].recall("../settings/lastUpdated") instanceof Error) {
M[storagePlace].store("../settings/lastUpdated", 0);
}

// adds listeners to the filter inputs
S.forEach(S.getId("importanceFilter").getElementsByTagName("input"), function (box) {
Expand Down Expand Up @@ -1945,10 +1948,8 @@

S.listen("update", "click", function () {
if (!this.disabled) {
S.forEach(M[storagePlace].list("/lists/", { shallowKeyList: true }), function (list) {
M[storagePlace].store("/lists/" + list + "/settings/lastUpdated", now.getTime());
M[storagePlace].store("/lists/" + list + "/lastUpdated", now.getTime());
});
M[storagePlace].forget("/lists/start-up settings/");
M[storagePlace].forget("/lists/last synchronized/");
M[storagePlace].store("/lists/last synchronized", now.getTime());
let backup = "{\n";
S.forEach(M[storagePlace].list("/lists/"), function (key) {
Expand Down

0 comments on commit d4deaed

Please sign in to comment.