- Du hast am {$inventory.at(-1).inventoryStartedAt} auf deinem aktuellen Gerät eine Inventur gestartet.
+ Du hast am {$inventoryStartedAt} auf deinem aktuellen Gerät eine Inventur gestartet.
Klicke oben rechts auf Reset, wenn du deinen Fortschritt löschen möchtest.
diff --git a/src/components/List.svelte b/src/components/List.svelte
index b7a375f..a797b38 100644
--- a/src/components/List.svelte
+++ b/src/components/List.svelte
@@ -36,7 +36,7 @@
{#each filteredDrinks as drink (drink.name)}
-
+
{/each}
{/if}
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 94cb571..5030e76 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -1,6 +1,6 @@
const backendProtocol = "http"
const backendHost = "localhost"
-const backendPort = "8151"
+const backendPort = "8161"
const backendEndpoint = "drinks"
export default class inventoryApi {
@@ -14,6 +14,7 @@ export default class inventoryApi {
static async reset() {
localStorage.removeItem("drinks")
+ localStorage.removeItem("inventoryStartedAt")
window.location.reload();
}
@@ -22,7 +23,7 @@ export default class inventoryApi {
inventory: inventory,
name: name,
comment: comment,
- timestamp: await inventoryApi.createTimestamp()
+ inventoryFinishedAt: inventoryApi.createTimestamp()
}
try {
@@ -40,7 +41,7 @@ export default class inventoryApi {
}
}
- static async createTimestamp() {
+ static createTimestamp() {
let _unixTime = Date.now();
let _date = new Date(_unixTime).toLocaleDateString();
let _time = new Date(_unixTime).toLocaleTimeString();
@@ -57,4 +58,4 @@ export default class inventoryApi {
inventoryApi.save("performingPerson", performingPerson)
}
-}
\ No newline at end of file
+}
diff --git a/src/stores/inventory.ts b/src/stores/inventory.ts
index 909b8d5..1d2f1c9 100644
--- a/src/stores/inventory.ts
+++ b/src/stores/inventory.ts
@@ -46,3 +46,5 @@ export const drinks = readable([
export const activeCategory = writable("")
export const inventory = writable([])
+
+export const inventoryStartedAt = writable("")
\ No newline at end of file