Skip to content

Commit

Permalink
fix: random theme is applied over custom theme (@fehmer) (#5900)
Browse files Browse the repository at this point in the history
When having a custom theme applied and random theme set both get
applied.

Custom theme:

![image](https://github.com/user-attachments/assets/e1a3e30b-c2ed-402c-a47f-12b0129781e7)

Custom theme mixed with chaos theory

![image](https://github.com/user-attachments/assets/17d8401d-55de-448e-8261-5d85004a631d)

Custom theme mixed with terrazzo

![image](https://github.com/user-attachments/assets/e424dd87-0d94-4909-ab42-69e65af02c41)
  • Loading branch information
fehmer authored Sep 20, 2024
1 parent 2dcb107 commit 921ecb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/ts/controllers/theme-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Misc from "../utils/misc";
import * as Arrays from "../utils/arrays";
import * as JSONData from "../utils/json-data";
import { isColorDark, isColorLight } from "../utils/colors";
import Config, { setAutoSwitchTheme } from "../config";
import Config, { setAutoSwitchTheme, setCustomTheme } from "../config";
import * as BackgroundFilter from "../elements/custom-background-filter";
import * as ConfigEvent from "../observables/config-event";
import * as DB from "../db";
Expand Down Expand Up @@ -302,6 +302,7 @@ export async function randomizeTheme(): Promise<void> {
randomTheme = "custom";
}

setCustomTheme(false, true);
await apply(randomTheme, colorsOverride);

if (randomThemeIndex >= themesList.length) {
Expand Down

0 comments on commit 921ecb1

Please sign in to comment.