boardzilla / boardzilla-core

Boardzilla core library
GNU Affero General Public License v3.0
179 stars 3 forks source link

calling game.finish() with an announcement causes an error #38

Open rizen opened 6 months ago

rizen commented 6 months ago

I can call game.finish() or game.finish(player) but if I call game.finish(player, 'foo') then the app crashes with this stack trace:

Screenshot 2024-03-07 at 4 31 38 PM
fevrisn commented 1 month ago

The string argument is not a string to be displayed to the users, but the identifier for the render, you need to implement this in ui/index.tsx:

render(setup, {
  // ... you will have a bunch of stuff here

  announcements: {
    foo: game => {
      return (
        <>
          <h1>Bar</h1>
        </>
      );
    }
  },
});