mirror of
https://github.com/rommapp/romm.git
synced 2026-02-19 07:50:57 +01:00
add default config to store
This commit is contained in:
@@ -104,10 +104,6 @@ onBeforeUnmount(() => {
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// api.get("/config").then(({ data: data }) => {
|
||||
// configStore.set(data);
|
||||
// });
|
||||
|
||||
api.get("/heartbeat").then(({ data: data }) => {
|
||||
heartbeat.set(data);
|
||||
});
|
||||
@@ -117,6 +113,10 @@ function fetchHomeData() {
|
||||
// Remove it so it's not called multiple times
|
||||
document.removeEventListener("network-quiesced", fetchHomeData);
|
||||
|
||||
api.get("/config").then(({ data: data }) => {
|
||||
configStore.set(data);
|
||||
});
|
||||
|
||||
userApi
|
||||
.fetchCurrentUser()
|
||||
.then(({ data: user }) => {
|
||||
|
||||
@@ -4,7 +4,21 @@ import type { ConfigResponse } from "@/__generated__";
|
||||
|
||||
export default defineStore("config", {
|
||||
state: () => {
|
||||
return { value: {} as ConfigResponse };
|
||||
return {
|
||||
value: {
|
||||
EXCLUDED_PLATFORMS: [] as string[],
|
||||
EXCLUDED_SINGLE_EXT: [] as string[],
|
||||
EXCLUDED_SINGLE_FILES: [] as string[],
|
||||
EXCLUDED_MULTI_FILES: [] as string[],
|
||||
EXCLUDED_MULTI_PARTS_EXT: [] as string[],
|
||||
EXCLUDED_MULTI_PARTS_FILES: [] as string[],
|
||||
PLATFORMS_BINDING: {} as Record<string, string>,
|
||||
PLATFORMS_VERSIONS: {} as Record<string, string>,
|
||||
ROMS_FOLDER_NAME: "",
|
||||
FIRMWARE_FOLDER_NAME: "",
|
||||
HIGH_PRIO_STRUCTURE_PATH: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user