Skip to content

Commit

Permalink
Fix notify for all posts switch field loading state (#3938)
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin authored Jan 19, 2024
1 parent e335054 commit 1aa7806
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ export default function () {
id="flarum_subscriptions__notify_for_all_posts"
state={!!this.user!.preferences()?.['flarum-subscriptions.notify_for_all_posts']}
onchange={(val: boolean) => {
this.user!.savePreferences({ 'flarum-subscriptions.notify_for_all_posts': val });
this.notifyForAllPostsLoading = true;

this.user!.savePreferences({ 'flarum-subscriptions.notify_for_all_posts': val }).then(() => {
this.notifyForAllPostsLoading = false;
m.redraw();
});
}}
loading={this.notifyForAllPostsLoading}
>
{app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')}
</Switch>
Expand Down

0 comments on commit 1aa7806

Please sign in to comment.