Skip to content

Commit

Permalink
fix: Fix TS error + set isPending on Button (#17118)
Browse files Browse the repository at this point in the history
  • Loading branch information
emrysal authored Oct 15, 2024
1 parent e2a825a commit f0cfbed
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions apps/web/modules/settings/my-account/appearance-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit f0cfbed

Please sign in to comment.