forked from noxious/client
started working on fixing typescript errors
This commit is contained in:
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
||||
export const useMapStore = defineStore('gameMap', {
|
||||
state: () => ({
|
||||
loaded: false,
|
||||
tiles: null,
|
||||
tiles: undefined,
|
||||
players: {}
|
||||
}),
|
||||
getters: {
|
||||
|
@ -5,6 +5,7 @@
|
||||
* https://pinia.vuejs.org/
|
||||
*/
|
||||
import { defineStore } from 'pinia';
|
||||
import {useMapStore} from '@/stores/map'
|
||||
import { io, Socket } from 'socket.io-client';
|
||||
import config from '@/config';
|
||||
import axios from 'axios';
|
||||
@ -70,16 +71,5 @@ export const useSocketStore = defineStore('socket', {
|
||||
this.socket = null;
|
||||
}
|
||||
},
|
||||
|
||||
getMap() {
|
||||
if (this.socket) {
|
||||
this.socket.emit('get_map');
|
||||
this.socket.on('map', (map) => {
|
||||
const mapStore = useMapStore();
|
||||
// Get map from server
|
||||
mapStore.setMap(map);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user