You've already forked AstralRinth
forked from didirus/AstralRinth
move profile listener
This commit is contained in:
@@ -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(() => {
|
const isPackLocked = computed(() => {
|
||||||
return props.instance.linked_data && props.instance.linked_data.locked
|
return props.instance.linked_data && props.instance.linked_data.locked
|
||||||
})
|
})
|
||||||
@@ -676,7 +662,6 @@ const toggleDisableMod = async (mod) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const removeMod = async (mod) => {
|
const removeMod = async (mod) => {
|
||||||
console.log(mod)
|
|
||||||
await remove_project(props.instance.path, mod.path).catch(handleError)
|
await remove_project(props.instance.path, mod.path).catch(handleError)
|
||||||
projects.value = projects.value.filter((x) => mod.path !== x.path)
|
projects.value = projects.value.filter((x) => mod.path !== x.path)
|
||||||
|
|
||||||
@@ -780,8 +765,19 @@ const unlisten = await getCurrentWebview().onDragDropEvent(async (event) => {
|
|||||||
await initProjects()
|
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(() => {
|
onUnmounted(() => {
|
||||||
unlisten()
|
unlisten()
|
||||||
|
unlistenProfiles()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user