diff --git a/package-lock.json b/package-lock.json index 5c71baa..7869744 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fifo", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fifo", - "version": "1.3.0", + "version": "1.3.1", "devDependencies": { "@sveltejs/adapter-auto": "^1.0.0", "@sveltejs/kit": "^1.0.0", diff --git a/package.json b/package.json index 2646d46..5dd19e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fifo", - "version": "1.3.0", + "version": "1.3.1", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/app.html b/src/app.html index 4aa5239..9eb4c8e 100644 --- a/src/app.html +++ b/src/app.html @@ -1,30 +1,88 @@ + + + + + + + + + + + + + + + + + + + + f•i•f•o | Simply, Rotating Queues + %sveltekit.head% + - - - - - - - - - - - - - - - - - - - f•i•f•o | Simply, Rotating Queues - %sveltekit.head% - - - -
%sveltekit.body%
- - - \ No newline at end of file + +
%sveltekit.body%
+ + diff --git a/src/lib/AddEditQ.svelte b/src/lib/AddEditQ.svelte index ebfcccd..dbfcc76 100644 --- a/src/lib/AddEditQ.svelte +++ b/src/lib/AddEditQ.svelte @@ -47,6 +47,11 @@ const handleItemAdd = () => { if (!newItemValue) return; + if (newItemValue.length > 10) { + error = "item name must be less than 10 characters"; + return; + } + const newItem = { id: crypto.randomUUID(), value: newItemValue, @@ -68,6 +73,11 @@ return; } + if (name.length > 10) { + error = "queue name must be less than 10 characters"; + return; + } + if (!items.length) { error = "please add atleast one item"; return; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8dda022..41bc4be 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -11,11 +11,18 @@ const localState = window.localStorage.getItem("fifo"); if (localState) queues = JSON.parse(localState); } + let deleteButtonLabel = ""; // Handlers const handleDeleteAll = () => { + if (!deleteButtonLabel.length) { + deleteButtonLabel = "Sure?"; + return; + } + if (browser) { queues = []; + deleteButtonLabel = ""; localStorage.removeItem("fifo"); } }; @@ -29,12 +36,15 @@

My Queues - + {#if queues.length} + + {/if}