Skip to content

Commit

Permalink
fix: (UNTESTED) enable themes when they are added to a preset
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls authored Jun 28, 2023
1 parent b96fafe commit 4aef55a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/Presets/AddThemeToPresetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { themeContext } from "@contexts/themeContext";
import { Modal, RadioDropdown } from "..";
import { useContext, useState, useMemo, useEffect } from "react";
import { Flags } from "ThemeTypes";
import { generatePresetFromThemeNames } from "backend";
import { generatePresetFromThemeNames, setThemeState } from "backend";
import { twMerge } from "tailwind-merge";

export function AddThemeToPresetButton() {
Expand Down Expand Up @@ -64,6 +64,9 @@ export function AddThemeToPresetButton() {
...selectedPreset.dependencies,
themeToAdd,
]).then(() => {
if (!themes.find((e) => e.name === themeToAdd).enabled) {
await setThemeState(themeToAdd, true)
}
refreshThemes();
});
}
Expand Down

0 comments on commit 4aef55a

Please sign in to comment.