Skip to content

Commit

Permalink
fix(flat-pages): don't update color scheme in preview when no query (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Feb 9, 2023
1 parent 25241c5 commit 04c0064
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/flat-pages/src/FilePreviewPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export const FilePreviewPage: React.FC<FilePreviewPageProps> = props => {

useIsomorphicLayoutEffect(() => {
const raw = query.get("theme");
if (!raw) {
return;
}
const theme: FlatPrefersColorScheme =
raw === "dark" ? "dark" : raw === "light" ? "light" : "auto";
preferencesStore.updatePrefersColorScheme(theme);
Expand Down

0 comments on commit 04c0064

Please sign in to comment.