Updated Dockerfile, renamed config key
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
name: import.meta.env.VITE_NAME,
|
||||
development: import.meta.env.VITE_DEVELOPMENT === 'true',
|
||||
environment: import.meta.env.VITE_ENVIRONMENT,
|
||||
server_endpoint: import.meta.env.VITE_SERVER_ENDPOINT,
|
||||
tile_size: {
|
||||
width: Number(import.meta.env.VITE_TILE_SIZE_WIDTH),
|
||||
|
@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
|
||||
if (!files) return
|
||||
gameStore.connection?.emit('gm:mapObject:upload', files, (response: boolean) => {
|
||||
if (!response) {
|
||||
if (config.development) console.error('Failed to upload object')
|
||||
if (config.environment === 'development') console.error('Failed to upload map object')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ const elementToScroll = ref()
|
||||
function newButtonClickHandler() {
|
||||
gameStore.connection?.emit('gm:sprite:create', {}, (response: boolean) => {
|
||||
if (!response) {
|
||||
if (config.development) console.error('Failed to create new sprite')
|
||||
if (config.environment === 'development') console.error('Failed to create new sprite')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
|
||||
if (!files) return
|
||||
gameStore.connection?.emit('gm:tile:upload', files, (response: boolean) => {
|
||||
if (!response) {
|
||||
if (config.development) console.error('Failed to upload tile')
|
||||
if (config.environment === 'development') console.error('Failed to upload tile')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ export const useGameStore = defineStore('game', {
|
||||
},
|
||||
initConnection() {
|
||||
this.connection = io(config.server_endpoint, {
|
||||
secure: !config.development,
|
||||
secure: !config.environment.includes('development'),
|
||||
withCredentials: true,
|
||||
transports: ['websocket'],
|
||||
reconnectionAttempts: 5
|
||||
|
Reference in New Issue
Block a user