clarkwinkelmann/flarum-ext-reset-preferences

Add a preference reset button to user settings

Installs: 222

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:TypeScript

Type:flarum-extension

1.0.0 2022-06-09 18:29 UTC

This package is auto-updated.

Last update: 2024-04-09 22:26:34 UTC


README

MIT license Latest Stable Version Total Downloads Donate

This extension allows users to reset all their preferences to the default value at once. This includes all notification settings which use the preference API behind the scenes. Since Flarum doesn't allow doing this natively, a new permission has been added to control access to this feature.

The reset is performed by clicking the new button at the bottom of the preferences page and confirming the prompt that appears.

Most extensions should play nice with this feature but there's a small risk some extensions freak out when the preferences are reset. Flarum doesn't have any preference change event natively, so this extension is not dispatching any either.

This extension could have unexpected side effects if some extensions use the preferences API to store hidden user state as preference. Those hidden values would be reset as well when the feature is used (example: UI language).

The extension will bypass features like fof/default-user-preferences because those extensions rely on hard-coding preference values during registration rather than changing the real underlying default.

Preferences stored as user attributes are not impacted (Byobu Block private discussions, Blomstra Digest frequency, etc).

Installation

composer require clarkwinkelmann/flarum-ext-reset-preferences

Support

This extension is under minimal maintenance.

It was developed for a client and released as open-source for the benefit of the community. I might publish simple bugfixes or compatibility updates for free.

You can contact me to sponsor additional features or updates.

Support is offered on a "best effort" basis through the Flarum community thread.

Links