Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

fix: remove some of the logs from the console so its more usable

tonyaellie1e30dc00058c
diff --git a/frontend/components/Item/View/Table.vue b/frontend/components/Item/View/Table.vue
index 231aa3d7..2d41a42b 100644
--- a/frontend/components/Item/View/Table.vue
+++ b/frontend/components/Item/View/Table.vue
@@ -210,8 +210,6 @@
}))
);
- console.log(headers.value);
-
const toggleHeader = (value: string) => {
const header = headers.value.find(h => h.value === value);
if (header) {
diff --git a/frontend/components/global/Currency.vue b/frontend/components/global/Currency.vue
index 2538c1c2..963d70d4 100644
--- a/frontend/components/global/Currency.vue
+++ b/frontend/components/global/Currency.vue
@@ -1,21 +1,41 @@
<template>
- {{ value }}
+ <Suspense>
+ <template #default>
+ {{ formattedValue }}
+ </template>
+ <template #fallback> Loading... </template>
+ </Suspense>
</template>
<script setup lang="ts">
+ import { ref, computed } from "vue";
+ import { useI18n } from "vue-i18n";
+
+ const { t } = useI18n();
+
type Props = {
amount: string | number;
};
const props = defineProps<Props>();
- const fmt = await useFormatCurrency();
+ const fmt = ref(null);
+
+ const loadFormatter = async () => {
+ fmt.value = await useFormatCurrency();
+ };
+
+ loadFormatter();
+
+ const formattedValue = computed(() => {
+ if (!fmt.value) {
+ return t("global.loading");
+ }
- const value = computed(() => {
if (!props.amount || props.amount === "0") {
- return fmt(0);
+ return fmt.value(0);
}
- return fmt(props.amount);
+ return fmt.value(props.amount);
});
</script>
diff --git a/frontend/locales/en.json b/frontend/locales/en.json
index f07fc0e8..3335a67a 100644
--- a/frontend/locales/en.json
+++ b/frontend/locales/en.json
@@ -156,7 +156,8 @@
"update": "Update",
"value": "Value",
"version": "Version: { version }",
- "welcome": "Welcome, { username }"
+ "welcome": "Welcome, { username }",
+ "loading": "Loading..."
},
"home": {
"labels": "Labels",