-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Default Theme in Multiplayer #10399
Conversation
…d a new pxtrcdeps (pxt react common dependencies) min.js file which includes (for now) just the DOMPurify code. Then I added a reference to it in skillmap.
…vars were used previously, but put back all the hardcoded values.
… but the little numbers on the right aren't themed to contrast in dark theme, and I was struggling to get them working. So just hard-code for now.
…ks/theme_multiplayer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -49,7 +49,7 @@ window.addEventListener("DOMContentLoaded", () => { | |||
const wc = pxt.webConfig as any; | |||
|
|||
for (const key of Object.keys(wc)) { | |||
if (wc[key]?.startsWith("/") && wc[key]?.indexOf("worker") == -1) { | |||
if (typeof wc[key] === "string" && wc[key]?.startsWith("/") && wc[key]?.indexOf("worker") == -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this makes me a bit worried that we have this constraint other places.. I'll have to take a look around to make sure I'm not breaking anything else. Thanks for fixing this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. TBH I don't think ocv is at fault here. Just an unsafe assumption in the code. ocv wasn't actually the first boolean value added to the config, just the first one that was actually set at this point.
…ks/theme_multiplayer
Good catch. Turns out there's some primary/secondary/tertiary color usage that I didn't notice. I'll update those. |
Themes impact multiplayer in a few places (though not many, since it primarily uses Tailwind). Notably, the settings dropdown and a few buttons. Actually supporting themes would be a big undertaking, so for now, I've just set it up to always load the default theme.
With themes, the presence buttons were getting dark backgrounds because they were disabled. This looked odd, so I've added a tailwind class to force them back to their white backgrounds instead.
I also had to fix a bug in our multiplayer serve that assumed all webconfig values were strings (no longer the case with ocv).
Upload Target: https://arcade.makecode.com/app/bd228f8101401d913f282b0c3585b210d67a903b-d766c6703c--multiplayer
Fixes microsoft/pxt-arcade#6722