From 312c32fb9c4084b490d27b9caeab9338c6badbe4 Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Sun, 16 Jun 2024 08:12:51 +0100 Subject: [PATCH] Revert "perf: only load user state when showing full user data (#50)" (#54) This reverts commit 4be7499f12aa94225b48fd2d6e87b27bc91a269c. --- .../components/UserPoliciesStateModal.js | 29 +------------------ src/Extenders/UserPoliciesRelationship.php | 8 +---- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/js/src/forum/components/UserPoliciesStateModal.js b/js/src/forum/components/UserPoliciesStateModal.js index d602f26..3aac9a8 100644 --- a/js/src/forum/components/UserPoliciesStateModal.js +++ b/js/src/forum/components/UserPoliciesStateModal.js @@ -2,29 +2,10 @@ import app from 'flarum/forum/app'; import humanTime from 'flarum/common/helpers/humanTime'; import Modal from 'flarum/common/components/Modal'; import sortByAttribute from '../../common/helpers/sortByAttribute'; -import LoadingIndicator from 'flarum/common/components/LoadingIndicator'; /* global m */ export default class UserPoliciesStateModal extends Modal { - user = null; - loading = false; - - oninit(vnode) { - super.oninit(vnode); - - if (this.attrs.user.fofTermsPoliciesState() === undefined) { - this.loading = true; - app.store.find('users', this.attrs.user.id()).then((user) => { - this.user = user; - this.loading = false; - m.redraw(); - }); - } else { - this.user = this.attrs.user; - } - } - title() { return app.translator.trans('fof-terms.forum.state-modal.title', { username: this.attrs.user.username(), @@ -32,20 +13,12 @@ export default class UserPoliciesStateModal extends Modal { } content() { - if (this.loading) { - return ( -