mirror of
https://github.com/penpot/penpot.git
synced 2026-11-14 05:50:38 +00:00
🐛 Fix default theme for penpot plugins (#12982)
This commit is contained in:
parent
88339e41a5
commit
180b1ef7cb
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user