Fxiing loading the Woka list

This commit is contained in:
David Négrier 2022-03-09 11:22:33 +01:00
parent 3760b9c4ad
commit 674c5bdeb8

View File

@ -43,7 +43,19 @@ export class CustomizeScene extends AbstractCharacterScene {
preload() {
const wokaMetadataKey = "woka-list";
this.cache.json.remove(wokaMetadataKey);
this.load.json(wokaMetadataKey, `${PUSHER_URL}/woka/list`);
// FIXME: window.location.href is wrong. We need the URL of the main room (so we need to apply any redirect before!)
this.load.json(
wokaMetadataKey,
`${PUSHER_URL}/woka/list/` + encodeURIComponent(window.location.href),
undefined,
{
responseType: "text",
headers: {
Authorization: localUserStore.getAuthToken() ?? "",
},
withCredentials: true,
}
);
this.load.once(`filecomplete-json-${wokaMetadataKey}`, () => {
this.playerTextures.loadPlayerTexturesMetadata(this.cache.json.get(wokaMetadataKey));
this.loadCustomSceneSelectCharacters()