HotFix handler message in chat store
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
parent
65c472d936
commit
f8ae189cee
@ -284,7 +284,7 @@ class IframeListener {
|
|||||||
|
|
||||||
registerScript(scriptUrl: string): Promise<void> {
|
registerScript(scriptUrl: string): Promise<void> {
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
console.log("Loading map related script at ", scriptUrl);
|
console.info("Loading map related script at ", scriptUrl);
|
||||||
|
|
||||||
if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") {
|
if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") {
|
||||||
// Using external iframe mode (
|
// Using external iframe mode (
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import { playersStore } from "./PlayersStore";
|
import { playersStore } from "./PlayersStore";
|
||||||
import type { PlayerInterface } from "../Phaser/Game/PlayerInterface";
|
import type { PlayerInterface } from "../Phaser/Game/PlayerInterface";
|
||||||
|
import { iframeListener } from "../Api/IframeListener";
|
||||||
|
|
||||||
export const chatVisibilityStore = writable(false);
|
export const chatVisibilityStore = writable(false);
|
||||||
export const chatInputFocusStore = writable(false);
|
export const chatInputFocusStore = writable(false);
|
||||||
@ -66,6 +67,9 @@ function createChatMessagesStore() {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
addPersonnalMessage(text: string) {
|
addPersonnalMessage(text: string) {
|
||||||
|
//post message iframe listener
|
||||||
|
iframeListener.sendUserInputChat(text);
|
||||||
|
|
||||||
newChatMessageStore.set(text);
|
newChatMessageStore.set(text);
|
||||||
update((list) => {
|
update((list) => {
|
||||||
const lastMessage = list[list.length - 1];
|
const lastMessage = list[list.length - 1];
|
||||||
|
Loading…
Reference in New Issue
Block a user