mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
Fix/fix broken pwa (#1086)
* remove fetch / use axios fix #1077 * revert checkbox change * add password peek * fix bool check
This commit is contained in:
parent
e743d2c66b
commit
ba325c12f7
4 changed files with 41 additions and 17 deletions
|
@ -1,13 +1,16 @@
|
|||
import { onMounted, ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { ref, Ref, useAsync, useContext } from "@nuxtjs/composition-api";
|
||||
import { useAsyncKey } from "../use-utils";
|
||||
import { AppInfo } from "~/types/api-types/admin";
|
||||
|
||||
export function useAppInfo(): Ref<AppInfo | null> {
|
||||
const appInfo = ref<null | AppInfo>(null);
|
||||
|
||||
onMounted(async () => {
|
||||
const data = await fetch("/api/app/about").then((res) => res.json());
|
||||
appInfo.value = data as AppInfo;
|
||||
});
|
||||
const { $axios } = useContext();
|
||||
|
||||
useAsync(async () => {
|
||||
const data = await $axios.get<AppInfo>("/api/app/about");
|
||||
appInfo.value = data.data;
|
||||
}, useAsyncKey());
|
||||
|
||||
return appInfo;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue