mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
When canceling editing profile colors reset colors
This commit is contained in:
parent
ca77e56474
commit
a62685e1e1
|
|
@ -162,7 +162,16 @@ const ProfilePage = (props: Props) => {
|
|||
) : null}
|
||||
{showColorSelectors ? (
|
||||
<ProfileColorSelectors
|
||||
hide={() => setShowColorSelectors(false)}
|
||||
hide={() => {
|
||||
setShowColorSelectors(false);
|
||||
const body = document.getElementsByTagName("body")[0];
|
||||
|
||||
for (const [key, value] of Object.entries(
|
||||
user.profile?.colors ?? {}
|
||||
)) {
|
||||
body.style.setProperty(`--custom-${key}`, value);
|
||||
}
|
||||
}}
|
||||
previousColors={
|
||||
(user.profile?.colors as Record<string, string>) ?? undefined
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user