Skip to content

Commit 04aad41

Browse files
authored
Prevent spinner when failed to mount (#112)
1 parent 86ee076 commit 04aad41

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/App.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,25 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
3333
nodeSearchEnabled.value = !e.detail;
3434
};
3535
36-
onMounted(async () => {
36+
const init = async () => {
3737
const nodeDefs = Object.values(await api.getNodeDefs());
3838
nodeSearchService.value = new NodeSearchService(nodeDefs);
39-
isLoading.value = false;
4039
4140
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
4241
document.addEventListener(
4342
"comfy:setting:litegraph-node-search",
4443
updateNodeSearchSetting
4544
);
45+
};
46+
47+
onMounted(async () => {
48+
try {
49+
await init();
50+
} catch (e) {
51+
console.error("Failed to init Vue app", e);
52+
} finally {
53+
isLoading.value = false;
54+
}
4655
});
4756
4857
onUnmounted(() => {

0 commit comments

Comments
 (0)