forked from noxious/client
Hot reload for objects when updated inside asset manager so no page reload is required
This commit is contained in:
@ -29,11 +29,14 @@
|
||||
import type { Object } from '@/types'
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { useAssetManagerStore } from '@/stores/assetManager'
|
||||
import { useZoneEditorStore } from '@/stores/zoneEditor'
|
||||
import { useSocketStore } from '@/stores/socket'
|
||||
import config from '@/config'
|
||||
|
||||
const socket = useSocketStore()
|
||||
const assetManagerStore = useAssetManagerStore()
|
||||
const zoneEditorStore = useZoneEditorStore()
|
||||
|
||||
const selectedObject = computed(() => assetManagerStore.selectedObject)
|
||||
|
||||
const objectName = ref('')
|
||||
@ -71,6 +74,11 @@ function refreshObjectList() {
|
||||
socket.connection.emit('gm:object:list', {}, (response: Object[]) => {
|
||||
assetManagerStore.setObjectList(response)
|
||||
assetManagerStore.setSelectedObject(null)
|
||||
|
||||
if (zoneEditorStore.active) {
|
||||
console.log('Refreshing object list for zone store')
|
||||
zoneEditorStore.setObjectList(response)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user