mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-12 14:16:04 -05:00
Fix can't reset custom CSS Closes #2349
This commit is contained in:
@@ -79,7 +79,13 @@ export function CustomizedColorsInput({
|
||||
</summary>
|
||||
<div>
|
||||
<Label>{t("custom.colors.title")}</Label>
|
||||
<input type="hidden" name="css" value={JSON.stringify(colorsWithDefaultsFilteredOut(colors, defaultColors))} />
|
||||
<input
|
||||
type="hidden"
|
||||
name="css"
|
||||
value={JSON.stringify(
|
||||
colorsWithDefaultsFilteredOut(colors, defaultColors),
|
||||
)}
|
||||
/>
|
||||
<div className="colors__container colors__grid">
|
||||
{CUSTOM_CSS_VAR_COLORS.filter(
|
||||
(cssVar) => cssVar !== "bg-lightest",
|
||||
@@ -112,9 +118,9 @@ export function CustomizedColorsInput({
|
||||
...colors,
|
||||
};
|
||||
if (cssVar === "bg-lighter") {
|
||||
newColors["bg-lightest"] = defaultColors.find((color) => color["bg-lightest"])?.[
|
||||
"bg-lightest"
|
||||
];
|
||||
newColors["bg-lightest"] = defaultColors.find(
|
||||
(color) => color["bg-lightest"],
|
||||
)?.["bg-lightest"];
|
||||
}
|
||||
setColors({
|
||||
...newColors,
|
||||
|
||||
@@ -151,8 +151,10 @@ test.describe("User page", () => {
|
||||
await goToEditPage(page);
|
||||
await page.locator("span").filter({ hasText: "Custom colors" }).click();
|
||||
|
||||
for (const button of await page.getByRole("button", { name: "Reset" }).all()) {
|
||||
await button.click();
|
||||
for (const button of await page
|
||||
.getByRole("button", { name: "Reset" })
|
||||
.all()) {
|
||||
await button.click();
|
||||
}
|
||||
|
||||
await submitEditForm(page);
|
||||
|
||||
Reference in New Issue
Block a user