Skip to content

Commit

Permalink
Merge pull request #243 from tosuapp/fix/tournament-chat
Browse files Browse the repository at this point in the history
fix: fix unnecessary tournament chat reset
  • Loading branch information
cyperdark authored Nov 22, 2024
2 parents aa44727 + 5e4b511 commit 466242c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/tosu/src/memory/stable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ export class StableMemory extends AbstractMemory<OsuPatternData> {
}
}

return [];
return false;
} catch (error) {
return error as Error;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tosu/src/memory/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export type ITourney =
| string
| Error;

export type ITourneyChat = ITourneyManagerChatItem[] | Error;
export type ITourneyChat = ITourneyManagerChatItem[] | Error | boolean;

export type ITourneyUser =
| {
Expand Down
1 change: 1 addition & 0 deletions packages/tosu/src/states/tourney.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class TourneyManager extends AbstractState {

const messages = this.game.memory.tourneyChat(this.messages);
if (messages instanceof Error) throw Error;
if (!Array.isArray(messages)) return;

this.messages = messages;

Expand Down

0 comments on commit 466242c

Please sign in to comment.