DEV: Why use a whole object when a functionw will do?

This commit is contained in:
Robin Ward 2020-05-29 11:56:45 -04:00
parent 94cb5ab172
commit e5cd331fb3
2 changed files with 6 additions and 9 deletions

View File

@ -5,7 +5,7 @@ import { setDefaultHomepage } from "discourse/lib/utilities";
import discourseComputed from "discourse-common/utils/decorators";
import { listThemes, setLocalTheme } from "discourse/lib/theme-selector";
import { popupAjaxError } from "discourse/lib/ajax-error";
import pageReloader from "discourse/helpers/page-reloader";
import { reload } from "discourse/helpers/page-reloader";
import {
safariHacksDisabled,
isiPad,
@ -193,7 +193,7 @@ export default Controller.extend({
}
if (this.themeId !== this.currentThemeId) {
pageReloader.reload();
reload();
}
})
.catch(popupAjaxError);

View File

@ -1,10 +1,7 @@
import EmberObject from "@ember/object";
import Ember from "ember";
export default EmberObject.create({
reload: function() {
if (!Ember.testing) {
location.reload();
}
export function reload() {
if (!Ember.testing) {
location.reload();
}
});
}