@@ -50,7 +40,7 @@
diff --git a/src/components/ui/sidebar/link.vue b/src/components/ui/sidebar/link/index.vue
similarity index 100%
rename from src/components/ui/sidebar/link.vue
rename to src/components/ui/sidebar/link/index.vue
diff --git a/src/components/vault/button/open.vue b/src/components/vault/button/open.vue
index cee4e88..643532a 100644
--- a/src/components/vault/button/open.vue
+++ b/src/components/vault/button/open.vue
@@ -71,7 +71,8 @@ const { add } = useSnackbar();
const handleError = (error: unknown) => {
isOpen.value = false;
- add({ type: "error", text: JSON.stringify(error) });
+ console.log("handleError", error, typeof error);
+ add({ type: "error", text: "Passwort falsch" });
//console.error(error);
};
@@ -100,6 +101,7 @@ const onLoadDatabase = async () => {
};
const localePath = useLocalePath();
+
const onOpenDatabase = async () => {
try {
check.value = true;
@@ -120,7 +122,10 @@ const onOpenDatabase = async () => {
});
if (!vaultId) {
- add({ type: "error", text: "Vault konnte nicht geöffnet werden" });
+ add({
+ type: "error",
+ text: "Vault konnte nicht geöffnet werden. \n Vermutlich ist das Passwort falsch",
+ });
return;
}
diff --git a/src/components/vault/card/index.vue b/src/components/vault/card/index.vue
index 4dc09ba..d141b99 100644
--- a/src/components/vault/card/index.vue
+++ b/src/components/vault/card/index.vue
@@ -1,14 +1,27 @@
-
+
+
diff --git a/src/composables/helper.ts b/src/composables/helper.ts
index 2d1cfb2..3589515 100644
--- a/src/composables/helper.ts
+++ b/src/composables/helper.ts
@@ -1,21 +1,21 @@
-import { H3Error } from 'h3';
+import { H3Error } from "h3";
export const bytesToBase64DataUrlAsync = async (
bytes: Uint8Array,
- type = 'application/octet-stream'
+ type = "application/octet-stream"
) => {
return await new Promise((resolve, reject) => {
const reader = Object.assign(new FileReader(), {
onload: () => resolve(reader.result),
onerror: () => reject(reader.error),
});
- reader.readAsDataURL(new File([new Blob([bytes])], '', { type }));
+ reader.readAsDataURL(new File([new Blob([bytes])], "", { type }));
});
};
export const blobToImageAsync = (blob: Blob): Promise
=> {
return new Promise((resolve) => {
- console.log('transform blob', blob);
+ console.log("transform blob", blob);
const url = URL.createObjectURL(blob);
let img = new Image();
img.onload = () => {
@@ -34,7 +34,7 @@ export const deepToRaw = >(sourceObj: T): T => {
if (isRef(input) || isReactive(input) || isProxy(input)) {
return objectIterator(toRaw(input));
}
- if (input && typeof input === 'object') {
+ if (input && typeof input === "object") {
return Object.keys(input).reduce((acc, key) => {
acc[key as keyof typeof acc] = objectIterator(input[key]);
return acc;
@@ -48,10 +48,9 @@ export const deepToRaw = >(sourceObj: T): T => {
export const readableFileSize = (sizeInByte: number | string = 0) => {
if (!sizeInByte) {
- return '0 KB';
+ return "0 KB";
}
- const size =
- typeof sizeInByte === 'string' ? parseInt(sizeInByte) : sizeInByte;
+ const size = typeof sizeInByte === "string" ? parseInt(sizeInByte) : sizeInByte;
const sizeInKb = size / 1024;
const sizeInMb = sizeInKb / 1024;
const sizeInGb = sizeInMb / 1024;
@@ -64,20 +63,17 @@ export const readableFileSize = (sizeInByte: number | string = 0) => {
return `${sizeInKb.toFixed(2)} KB`;
};
-import type { LocationQueryValue, RouteLocationRawI18n } from 'vue-router';
+import type { LocationQueryValue, RouteLocationRawI18n } from "vue-router";
export const getSingleRouteParam = (
param: string | string[] | LocationQueryValue | LocationQueryValue[]
): string => {
- const _param = Array.isArray(param) ? param.at(0) ?? '' : param ?? '';
+ const _param = Array.isArray(param) ? param.at(0) ?? "" : param ?? "";
//console.log('found param', _param, param);
- return _param;
+ return decodeURIComponent(_param);
};
-export const isRouteActive = (
- to: RouteLocationRawI18n,
- exact: boolean = false
-) =>
+export const isRouteActive = (to: RouteLocationRawI18n, exact: boolean = false) =>
computed(() => {
const found = useRouter()
.getRoutes()
@@ -86,9 +82,7 @@ export const isRouteActive = (
return exact
? found?.name === useRouter().currentRoute.value.name
: found?.name === useRouter().currentRoute.value.name ||
- found?.children.some(
- (child) => child.name === useRouter().currentRoute.value.name
- );
+ found?.children.some((child) => child.name === useRouter().currentRoute.value.name);
});
export const isKey = (x: T, k: PropertyKey): k is keyof T => {
diff --git a/src/layouts/app.vue b/src/layouts/app.vue
index 0a8baf7..bd191a0 100644
--- a/src/layouts/app.vue
+++ b/src/layouts/app.vue
@@ -1,32 +1,27 @@
-
+