diff --git a/src/components/utilities/zoneEditor/partials/ZoneList.vue b/src/components/utilities/zoneEditor/partials/ZoneList.vue index 1e6b9b0..b64e4d8 100644 --- a/src/components/utilities/zoneEditor/partials/ZoneList.vue +++ b/src/components/utilities/zoneEditor/partials/ZoneList.vue @@ -44,21 +44,21 @@ onMounted(async () => { }) function fetchZones() { - gameStore.connection.emit('gm:zone_editor:zone:list', {}, (response: Zone[]) => { + gameStore.connection?.emit('gm:zone_editor:zone:list', {}, (response: Zone[]) => { zoneEditorStore.setZoneList(response) }) } function loadZone(id: number) { console.log('loadZone', id) - gameStore.connection.emit('gm:zone_editor:zone:request', { zoneId: id }, (response: Zone) => { + gameStore.connection?.emit('gm:zone_editor:zone:request', { zoneId: id }, (response: Zone) => { zoneEditorStore.setZone(response) }) zoneEditorStore.toggleZoneListModal() } function deleteZone(id: number) { - gameStore.connection.emit('gm:zone_editor:zone:delete', { zoneId: id }, () => { + gameStore.connection?.emit('gm:zone_editor:zone:delete', { zoneId: id }, () => { fetchZones() }) }