1
0
forked from noxious/client

TS improvement

This commit is contained in:
Dennis Postma 2024-08-21 21:29:07 +02:00
parent 94f8398545
commit 9f71107a00

View File

@ -44,21 +44,21 @@ onMounted(async () => {
}) })
function fetchZones() { 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) zoneEditorStore.setZoneList(response)
}) })
} }
function loadZone(id: number) { function loadZone(id: number) {
console.log('loadZone', id) 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.setZone(response)
}) })
zoneEditorStore.toggleZoneListModal() zoneEditorStore.toggleZoneListModal()
} }
function deleteZone(id: number) { 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() fetchZones()
}) })
} }