Skip to content

Commit

Permalink
#299 fixing the bug, it wasn't unsubscribing, and so it was continuin…
Browse files Browse the repository at this point in the history
…g to get message from the older subscriptions as well
  • Loading branch information
Daniel-Ventura-25 committed Nov 30, 2022
1 parent 7286b49 commit 4c774d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ export default class mcdo_RetrieveTable extends LightningElement {
const progressMessageCallback = async (response) => {
if (response.data.payload.copado__Progress_Status__c === "Refresh done") {
this.unsubscribeThisSubscription(this.getProgressSubscription);
this.progressStatus = "Completed!";
} else {
// call an apex function that got the result status
getJobProgress({ jobExecutionId: jobExecutionId })
.then((result) => {
console.log(JSON.stringify(result));
this.progressStatus = result.progress || result.status;
})
.catch((error) => {
Expand Down Expand Up @@ -390,7 +390,7 @@ export default class mcdo_RetrieveTable extends LightningElement {

async unsubscribeThisSubscription(subscription) {
try {
unsubscribeEmp(subscription);
unsubscribeEmp(subscription, () => {});
} catch (err) {
this.showError(
`${err.name}: An error occurred while unsubscribing from Emp API`,
Expand Down

0 comments on commit 4c774d0

Please sign in to comment.