Skip to content

Commit

Permalink
prefer early exit
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 committed Feb 4, 2024
1 parent 49d02e7 commit 2ef75a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ext/js/pages/settings/text-transformations-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ export class TextTransformationsController {
* @param {import('settings-controller').EventArgument<'optionsChanged'>} details
*/
async _onOptionsChanged({options}) {
if (options.general.language !== this._language) {
this._language = options.general.language;

this._clearSettingsItems();
this._transformations = await this._settingsController.application.api.getTextTransformations(this._language);
this._renderSettingsItems();
if (options.general.language === this._language) {
return;
}

this._language = options.general.language;

this._clearSettingsItems();
this._transformations = await this._settingsController.application.api.getTextTransformations(this._language);
this._renderSettingsItems();
}

/** */
Expand Down

0 comments on commit 2ef75a8

Please sign in to comment.