Only set config hash if present in update response

Prevents infinite reloading if the update response doesn't contain a hash for some reason
This commit is contained in:
James Lyne 2021-08-03 02:26:43 +01:00
parent ac806a3a6b
commit 6aa9aaf2bd

View File

@ -717,7 +717,10 @@ export default class DynmapMapProvider extends MapProvider {
this.store.commit(MutationTypes.ADD_MARKER_SET_UPDATES, updates.markerSets); this.store.commit(MutationTypes.ADD_MARKER_SET_UPDATES, updates.markerSets);
this.store.commit(MutationTypes.ADD_TILE_UPDATES, updates.tiles); this.store.commit(MutationTypes.ADD_TILE_UPDATES, updates.tiles);
this.store.commit(MutationTypes.ADD_CHAT, updates.chat); this.store.commit(MutationTypes.ADD_CHAT, updates.chat);
if(response.configHash) {
this.store.commit(MutationTypes.SET_SERVER_CONFIGURATION_HASH, response.confighash || 0); this.store.commit(MutationTypes.SET_SERVER_CONFIGURATION_HASH, response.confighash || 0);
}
await this.store.dispatch(ActionTypes.SET_PLAYERS, players); await this.store.dispatch(ActionTypes.SET_PLAYERS, players);
} }