Skip to content

Commit

Permalink
DEV: Remove unused topic-timeline modification
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed Oct 1, 2024
1 parent 929dc6f commit 175d3db
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions assets/javascripts/discourse/initializers/extend-for-salesforce.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,6 @@ async function createPerson(type, post) {
}
}

function syncCaseForTopic(context) {
const topic = context.topic;
const op = context.topic
.get("postStream.posts")
.find((p) => p.post_number === 1);

topic.set("salesforce_case", spinnerHTML);
context.appEvents.trigger("post-stream:refresh", {
id: op.id,
});

ajax(`/salesforce/cases/sync`, {
type: "POST",
data: { topic_id: topic.id },
})
.catch(popupAjaxError)
.then((data) => {
topic.set("salesforce_case", data["case"]);
context.appEvents.trigger("post-stream:refresh", {
id: op.id,
});
});
}

function initializeWithApi(api, container) {
const currentUser = api.getCurrentUser();
const isStaff = currentUser?.staff;
Expand Down Expand Up @@ -197,13 +173,6 @@ function initializeWithApi(api, container) {
};
}
});

api.modifyClass("component:topic-timeline", {
pluginId: PLUGIN_ID,
syncCase() {
return syncCaseForTopic(this);
},
});
}
}

Expand Down

0 comments on commit 175d3db

Please sign in to comment.