Autmor / yourTurn

Foundry Module that adds a visual display whenever the turn changes.
6 stars 15 forks source link

Error if a player logs in before a GM #14

Open kaelad02 opened 1 year ago

kaelad02 commented 1 year ago

I noticed an issue where the banner was not showing up. I opened the browser's console and saw an error message. If I wait for the GM to login, then refresh it solves the problem.

image

I believe the bug is on the previous line, line 18:

const firstGm = game.users.find((u) => u.isGM && u.active);

It's looking for the first active GM but sometimes the GM isn't logged in yet. Do we need to have the u.active check? The problem is the line throws an error so it doesn't setup the updateCombat hook, which explains why the banner doesn't show up.

EndlessFractal commented 1 year ago

Can you please verify if the issue still occurs on my fork? I've done some work on it, ported to the latest version and patched many bugs over on my fork. Please check at your leisure!

https://github.com/EndlessFractal/yourTurn