fix: random theme is applied over custom theme (@fehmer) (#5900)

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)
This commit is contained in:
Christian Fehmer 2024-09-20 08:58:15 +02:00 committed by GitHub
parent 2dcb1072e1
commit 921ecb113f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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";
@ -302,6 +302,7 @@ export async function randomizeTheme(): Promise<void> {
randomTheme = "custom";
}
setCustomTheme(false, true);
await apply(randomTheme, colorsOverride);
if (randomThemeIndex >= themesList.length) {