From 54f7a41c49230243a115aaf2286f639da0bef538 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Mon, 7 Dec 2020 15:46:16 -0500 Subject: [PATCH] Add alert if nicknames display name driver not enabled --- extensions/nicknames/js/src/admin/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/extensions/nicknames/js/src/admin/index.js b/extensions/nicknames/js/src/admin/index.js index a119a765e..936050a91 100644 --- a/extensions/nicknames/js/src/admin/index.js +++ b/extensions/nicknames/js/src/admin/index.js @@ -1,6 +1,20 @@ +import Alert from 'flarum/common/components/Alert'; +import Link from 'flarum/common/components/Link'; + app.initializers.add('flarum/nicknames', () => { app.extensionData .for('flarum-nicknames') + .registerSetting(function () { + if (app.data.settings.display_name_driver === 'nickname') return; + + return ( +
+ + {app.translator.trans('flarum-nicknames.admin.wrong_driver', {a: })} + +
+ ); + }) .registerSetting({ setting: 'flarum-nicknames.unique', type: 'boolean',