From 93e739f35c144e5452da9504135e6d9b8bffa6c2 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 10 Sep 2024 17:07:29 -0300 Subject: [PATCH] Create a constant for store local storage order name --- src/stores/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stores/app.js b/src/stores/app.js index 1f2ea229..184fbb71 100644 --- a/src/stores/app.js +++ b/src/stores/app.js @@ -5,6 +5,7 @@ import { i18n } from 'src/boot/i18n'; import { useQuasar } from 'quasar'; const { notify } = useNotify(); +const storageOrderName = 'hederaBasket'; export const useAppStore = defineStore('hedera', { state: () => ({ @@ -72,7 +73,7 @@ export const useAppStore = defineStore('hedera', { }, getBasketOrderId() { - this.basketOrderId = localStorage.getItem('hederaBasket'); + this.basketOrderId = localStorage.getItem(storageOrderName); }, async checkOrder(orderId) { @@ -130,13 +131,13 @@ export const useAppStore = defineStore('hedera', { loadIntoBasket(orderId) { if (this.basketOrderId !== orderId) { this.basketOrderId = orderId; - localStorage.setItem('hederaBasket', orderId); + localStorage.setItem(storageOrderName, orderId); notify('orderLoadedIntoBasket', 'positive'); } }, unloadOrder() { - localStorage.removeItem('hederaBasket'); + localStorage.removeItem(storageOrderName); this.basketOrderId = null; } },