Skip to content

Commit

Permalink
refactor: unify frontend initializers naming (#4003)
Browse files Browse the repository at this point in the history
* refactor: use consistent naming for frontend initializers

* refactor: use arrow functions for frontend initializers
  • Loading branch information
DavideIadeluca authored Jun 22, 2024
1 parent d52068c commit c8dc8f6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extensions/lock/js/src/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import app from 'flarum/admin/app';

export { default as extend } from './extend';

app.initializers.add('lock', () => {
app.initializers.add('flarum-lock', () => {
app.extensionData.for('flarum-lock').registerPermission(
{
icon: 'fas fa-lock',
Expand Down
2 changes: 1 addition & 1 deletion extensions/mentions/js/src/admin/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import app from 'flarum/admin/app';

app.initializers.add('flarum-mentions', function () {
app.initializers.add('flarum-mentions', () => {
app.extensionData
.for('flarum-mentions')
.registerSetting({
Expand Down
2 changes: 1 addition & 1 deletion extensions/mentions/js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ app.mentionFormats = new MentionFormats();

export { default as extend } from './extend';

app.initializers.add('flarum-mentions', function () {
app.initializers.add('flarum-mentions', () => {
// For every mention of a post inside a post's content, set up a hover handler
// that shows a preview of the mentioned post.
addPostMentionPreviews();
Expand Down
2 changes: 1 addition & 1 deletion extensions/nicknames/js/src/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BasicsPage from 'flarum/admin/components/BasicsPage';
import extractText from 'flarum/common/utils/extractText';
import { extend } from 'flarum/common/extend';

app.initializers.add('flarum/nicknames', () => {
app.initializers.add('flarum-nicknames', () => {
app.extensionData
.for('flarum-nicknames')
.registerSetting(function () {
Expand Down
2 changes: 1 addition & 1 deletion extensions/nicknames/js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import NickNameModal from './components/NicknameModal';

export { default as extend } from './extend';

app.initializers.add('flarum/nicknames', () => {
app.initializers.add('flarum-nicknames', () => {
extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {
if (app.forum.attribute('displayNameDriver') !== 'nickname') return;

Expand Down
2 changes: 1 addition & 1 deletion extensions/subscriptions/js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import addSubscriptionSettings from './addSubscriptionSettings';

export { default as extend } from './extend';

app.initializers.add('subscriptions', function () {
app.initializers.add('flarum-subscriptions', () => {
addSubscriptionBadge();
addSubscriptionControls();
addSubscriptionFilter();
Expand Down
2 changes: 1 addition & 1 deletion extensions/tags/js/src/forum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import addTagComposer from './addTagComposer';

export { default as extend } from './extend';

app.initializers.add('flarum-tags', function () {
app.initializers.add('flarum-tags', () => {
app.tagList = new TagListState();

addTagList();
Expand Down

0 comments on commit c8dc8f6

Please sign in to comment.