mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
Prevent spinner when failed to mount (#112)
This commit is contained in:
13
src/App.vue
13
src/App.vue
@@ -33,16 +33,25 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
|
|||||||
nodeSearchEnabled.value = !e.detail;
|
nodeSearchEnabled.value = !e.detail;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
const init = async () => {
|
||||||
const nodeDefs = Object.values(await api.getNodeDefs());
|
const nodeDefs = Object.values(await api.getNodeDefs());
|
||||||
nodeSearchService.value = new NodeSearchService(nodeDefs);
|
nodeSearchService.value = new NodeSearchService(nodeDefs);
|
||||||
isLoading.value = false;
|
|
||||||
|
|
||||||
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
|
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
"comfy:setting:litegraph-node-search",
|
"comfy:setting:litegraph-node-search",
|
||||||
updateNodeSearchSetting
|
updateNodeSearchSetting
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
await init();
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to init Vue app", e);
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user