Skip to content

Commit

Permalink
Test talk track is not empty before pulling state
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Feb 4, 2024
1 parent 7db2cba commit cd9617a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,12 @@ export class Scheduler {
);

try {
const nameEventContent = await this.client.getRoomStateEvent(confAud.roomId, "m.room.name", "");
if (task.talk.track != '' && task.talk.track != undefined && task.talk.track != nameEventContent["name"]) {
nameEventContent["name"] = task.talk.track;
await this.client.sendStateEvent(confAud.roomId, "m.room.name", "", nameEventContent);
if (task.talk.track != '' && task.talk.track != undefined) {
const nameEventContent = await this.client.getRoomStateEvent(confAud.roomId, "m.room.name", "");
if (task.talk.track != nameEventContent["name"]) {
nameEventContent["name"] = task.talk.track;
await this.client.sendStateEvent(confAud.roomId, "m.room.name", "", nameEventContent);
}
}
} catch (e) {
LogService.error("Scheduler:talkStart", `Error when considering changing name of track room`, e);
Expand Down

0 comments on commit cd9617a

Please sign in to comment.