mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
Fix an EvenHub compatibility issue when a text container is updated with only an ID and not a container name
This commit is contained in:
1 parent
90603b5aa4
commit
5abbe2a405
1 file changed
+6
-1
@@ -703,8 +703,13 @@ export class EvenHubSession implements EvenHubMicClient, EvenHubImuClient {
|
||||
|
||||
private textUpgrade(data: Record<string, unknown>): boolean {
|
||||
const id = readNumber(data, "containerID", -1);
|
||||
// containerID is the identity; containerName is optional in the wild (e.g.
|
||||
// level-even-g2 omits it). Match by id, enforcing the name only when the app
|
||||
// actually supplies a non-empty one. (updateImage already matches by id.)
|
||||
const name = readString(data, "containerName", "");
|
||||
const container = this.page?.containers.find((c) => c.kind === "text" && c.id === id && c.name === name);
|
||||
const container = this.page?.containers.find(
|
||||
(c) => c.kind === "text" && c.id === id && (name === "" || c.name === name),
|
||||
);
|
||||
if (!container || container.kind !== "text") return false;
|
||||
const content = readString(data, "content", "");
|
||||
const offset = readOptionalNumber(data, "contentOffset");
|
||||
|
||||
Reference in new issue
Block a user