fix: Fix TS error + set isPending on Button (#17118)
This commit is contained in:
1 parent
e2a825a9a0
commit
f0cfbede7e
1 file changed
+3
-12
@@ -193,20 +193,10 @@ const AppearanceView = ({
|
||||
<Form
|
||||
form={userAppThemeFormMethods}
|
||||
handleSubmit={({ appTheme }) => {
|
||||
if (appTheme === "light" || appTheme === "dark") {
|
||||
mutation.mutate({
|
||||
appTheme,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (appTheme === "system") appTheme = null;
|
||||
mutation.mutate({
|
||||
appTheme: null,
|
||||
appTheme,
|
||||
});
|
||||
if (values.appTheme === "light") {
|
||||
document.body.classList.remove("dark");
|
||||
} else if (values.appTheme === "dark") {
|
||||
document.body.classList.remove("light");
|
||||
}
|
||||
}}>
|
||||
<div className="border-subtle flex flex-col justify-between border-x px-6 py-8 sm:flex-row">
|
||||
<ThemeLabel
|
||||
@@ -236,6 +226,7 @@ const AppearanceView = ({
|
||||
</div>
|
||||
<SectionBottomActions className="mb-6" align="end">
|
||||
<Button
|
||||
loading={mutation.isPending}
|
||||
disabled={isUserAppThemeSubmitting || !isUserAppThemeDirty}
|
||||
type="submit"
|
||||
data-testid="update-app-theme-btn"
|
||||
|
||||
Reference in new issue
Block a user