1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Allow locale to be selected in footer

This commit is contained in:
Toby Zerner
2015-08-05 09:50:57 +09:30
parent 48df9bb678
commit f49d0e5341
11 changed files with 87 additions and 18 deletions

View File

@@ -98,13 +98,10 @@ export default class SettingsPage extends UserPage {
*/
preferenceSaver(key) {
return (value, component) => {
const preferences = this.user.preferences();
preferences[key] = value;
if (component) component.loading = true;
m.redraw();
this.user.save({preferences}).then(() => {
this.user.savePreferences({[key]: value}).then(() => {
if (component) component.loading = false;
m.redraw();
});