From b5d788ca6c8cd5eefc898e0db14664b5b3dffeca Mon Sep 17 00:00:00 2001 From: Jai A Date: Sat, 14 Dec 2024 22:02:38 -0700 Subject: [PATCH] move profile listener --- apps/app-frontend/src/pages/instance/Mods.vue | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/apps/app-frontend/src/pages/instance/Mods.vue b/apps/app-frontend/src/pages/instance/Mods.vue index 48dce1a1c..fb5265962 100644 --- a/apps/app-frontend/src/pages/instance/Mods.vue +++ b/apps/app-frontend/src/pages/instance/Mods.vue @@ -311,20 +311,6 @@ const props = defineProps({ }, }) -const unlistenProfiles = await profile_listener(async (event) => { - if ( - event.profile_path_id === props.instance.path && - event.event === 'synced' && - props.instance.install_stage !== 'pack_installing' - ) { - await initProjects() - } -}) - -onUnmounted(() => { - unlistenProfiles() -}) - const isPackLocked = computed(() => { return props.instance.linked_data && props.instance.linked_data.locked }) @@ -676,7 +662,6 @@ const toggleDisableMod = async (mod) => { } const removeMod = async (mod) => { - console.log(mod) await remove_project(props.instance.path, mod.path).catch(handleError) projects.value = projects.value.filter((x) => mod.path !== x.path) @@ -780,8 +765,19 @@ const unlisten = await getCurrentWebview().onDragDropEvent(async (event) => { await initProjects() }) +const unlistenProfiles = await profile_listener(async (event) => { + if ( + event.profile_path_id === props.instance.path && + event.event === 'synced' && + props.instance.install_stage !== 'pack_installing' + ) { + await initProjects() + } +}) + onUnmounted(() => { unlisten() + unlistenProfiles() })