Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove unused `userInvitedShow` logic (#23569)

Jarek Radosz61f4af299544
diff --git a/app/assets/javascripts/discourse/app/components/invite-panel.js b/app/assets/javascripts/discourse/app/components/invite-panel.js
index 0fd70f875ad..6a27bd99bfc 100644
--- a/app/assets/javascripts/discourse/app/components/invite-panel.js
+++ b/app/assets/javascripts/discourse/app/components/invite-panel.js
@@ -3,7 +3,6 @@ import { alias, and, equal, readOnly } from "@ember/object/computed";
import Component from "@ember/component";
import Group from "discourse/models/group";
import I18n from "I18n";
-import Invite from "discourse/models/invite";
import discourseComputed from "discourse-common/utils/decorators";
import { emailValid } from "discourse/lib/utilities";
import { getNativeContact } from "discourse/lib/pwa-utils";
@@ -16,7 +15,6 @@ export default Component.extend({
allGroups: null,
inviteModel: alias("panel.model.inviteModel"),
- userInvitedShow: alias("panel.model.userInvitedShow"),
isStaff: readOnly("currentUser.staff"),
isAdmin: readOnly("currentUser.admin"),
@@ -329,8 +327,6 @@ export default Component.extend({
}
const groupIds = this.groupIds;
- const userInvitedController = this.userInvitedShow;
-
const model = this.inviteModel;
model.setProperties({ saving: true, error: false });
@@ -363,17 +359,7 @@ export default Component.extend({
.createInvite(this.invitee.trim(), groupIds, this.customMessage)
.then((result) => {
model.setProperties({ saving: false, finished: true });
- if (!this.invitingToTopic && userInvitedController) {
- Invite.findInvitedBy(
- this.currentUser,
- userInvitedController.get("filter")
- ).then((inviteModel) => {
- userInvitedController.setProperties({
- model: inviteModel,
- totalInvites: inviteModel.invites.length,
- });
- });
- } else if (this.isPM && result && result.user) {
+ if (this.isPM && result && result.user) {
this.get("inviteModel.details.allowed_users").pushObject(
EmberObject.create(result.user)
);
@@ -398,7 +384,6 @@ export default Component.extend({
}
const groupIds = this.groupIds;
- const userInvitedController = this.userInvitedShow;
const model = this.inviteModel;
model.setProperties({ saving: true, error: false });
@@ -415,18 +400,6 @@ export default Component.extend({
finished: true,
inviteLink: result.link,
});
-
- if (userInvitedController) {
- Invite.findInvitedBy(
- this.currentUser,
- userInvitedController.get("filter")
- ).then((inviteModel) => {
- userInvitedController.setProperties({
- model: inviteModel,
- totalInvites: inviteModel.invites.length,
- });
- });
- }
})
.catch((e) => {
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {