From d3517a10c67d7b6511185c1614cd1652d73c9048 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 19 Jul 2021 17:46:05 +0200 Subject: [PATCH] Cleanup --- package.json | 4 ++-- src/modules/listHistory.old.js | 29 ----------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 src/modules/listHistory.old.js diff --git a/package.json b/package.json index 0188a6333..c82d23e5f 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,11 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build --modern", - "test:unit": "jest", - "lint": "vue-cli-service lint --ignore-pattern '*.test.*'", "build:report": "vue-cli-service build --report", + "lint": "vue-cli-service lint --ignore-pattern '*.test.*'", "cypress:open": "cypress open", "serve:dist": "node scripts/serve-dist.js", + "test:unit": "jest", "test:frontend": "cypress run" }, "dependencies": { diff --git a/src/modules/listHistory.old.js b/src/modules/listHistory.old.js deleted file mode 100644 index 0a5c0bb73..000000000 --- a/src/modules/listHistory.old.js +++ /dev/null @@ -1,29 +0,0 @@ -export const getHistory = () => { - const savedHistory = localStorage.getItem('listHistory') - if (savedHistory === null) { - return [] - } - - return JSON.parse(savedHistory) -} - -export function saveListToHistory(list) { - const history = getHistory() - - list.id = parseInt(list.id) - - // Remove the element if it already exists in history, preventing duplicates and essentially moving it to the beginning - for (const i in history) { - if (history[i].id === list.id) { - history.splice(i, 1) - } - } - - // Add the new list to the beginning of the list - history.unshift(list) - - if (history.length > 5) { - history.pop() - } - localStorage.setItem('listHistory', JSON.stringify(history)) -}