1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Fix notify for all posts switch field loading state (#3938)

This commit is contained in:
Ngô Quốc Đạt
2024-01-19 18:04:25 +07:00
committed by GitHub
parent e3350543af
commit 1aa7806244

View File

@@ -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>