🐛 Fix default theme for penpot plugins (#12982)

This commit is contained in:
Alonso Torres 2026-11-11 14:16:20 +01:00 committed by GitHub
parent 88339e41a5
commit 180b1ef7cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 21 additions and 7 deletions

View File

@ -72,7 +72,9 @@ export class AppComponent {
messages$ = fromEvent<MessageEvent<PluginMessageEvent>>(window, 'message');
initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
theme = toSignal(

View File

@ -115,7 +115,9 @@ export class AppComponent {
#messages$ = fromEvent<MessageEvent<PluginMessageEvent>>(window, 'message');
#initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
selection = toSignal(

View File

@ -44,7 +44,9 @@ export class AppComponent {
);
public initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
public theme = toSignal(

View File

@ -69,7 +69,9 @@ export class AppComponent {
messages$ = fromEvent<MessageEvent<PluginMessageEvent>>(window, 'message');
initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
theme = toSignal(

View File

@ -44,7 +44,9 @@ export class AppComponent {
);
public initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
public theme = toSignal(

View File

@ -38,7 +38,9 @@ export class AppComponent {
}
initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
theme = toSignal(

View File

@ -40,7 +40,9 @@ export class AppComponent {
messages$ = fromEvent<MessageEvent<PluginMessageEvent>>(window, 'message');
initialTheme$ = of(
new URLSearchParams(window.location.search).get('theme'),
// The theme arrives in the query string or in the query part of the hash.
new URLSearchParams(window.location.search).get('theme') ??
new URLSearchParams(window.location.hash.split('?')[1]).get('theme'),
).pipe(filter((theme) => !!theme));
theme = toSignal(