From 051f91c02524fdbec140d1c2634e0490a0a0030e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sof=C3=ADa=20Aritz?= Date: Tue, 28 Mar 2023 18:50:55 +0200 Subject: [PATCH] Fix saving feature --- src/lib/saving.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/saving.js b/src/lib/saving.js index 933c36f..40756ce 100644 --- a/src/lib/saving.js +++ b/src/lib/saving.js @@ -3,7 +3,10 @@ export function save_file(input) { } export function load_file() { - localStorage.getItem("last_item") + let item = localStorage.getItem("last_item") + if (item.length > 0) { + return item + } } export function save_style(style) { @@ -11,5 +14,8 @@ export function save_style(style) { } export function load_style() { - localStorage.getItem("last_style") + let item = localStorage.getItem("last_style") + if (item.length > 0) { + return item + } }