Skip to content

Commit

Permalink
Merge pull request #166 from SaTT-Wallet/162-profiledelete-account-vi…
Browse files Browse the repository at this point in the history
…a-close-button

delete channel without the need of refresh page
  • Loading branch information
hichri-louay authored Mar 28, 2024
2 parents a8c2792 + 91c4cfc commit 854d03e
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,12 @@ goToAccount(oracle: string, userName: string) {
.pipe(takeUntil(this.isDestroyed))
.subscribe((response: any) => {
if (response.message === 'deleted successfully') {
const index = this.channelTwitter.findIndex((ch: {
_id: string;
}) => ch._id === id);
if (index !== -1) {
this.channelTwitter.splice(index, 1);
}
this.socialAccountFacadeService.dispatchUpdatedSocailAccount();
//this.getSocialNetwork();
this.closeModal(id);
Expand All @@ -544,6 +550,12 @@ goToAccount(oracle: string, userName: string) {
.pipe(takeUntil(this.isDestroyed))
.subscribe((response: any) => {
if (response.message === 'deleted successfully') {
const index = this.channelFacebook.findIndex((ch: {
_id: string;
}) => ch._id === id);
if (index !== -1) {
this.channelFacebook.splice(index, 1);
}
this.socialAccountFacadeService.dispatchUpdatedSocailAccount();
//this.getSocialNetwork();
this.closeModal(id);
Expand All @@ -555,6 +567,12 @@ goToAccount(oracle: string, userName: string) {
.pipe(takeUntil(this.isDestroyed))
.subscribe((response: any) => {
if (response.message === 'deleted successfully') {
const index = this.channelLinkedin.findIndex((ch: {
_id: string;
}) => ch._id === id);
if (index !== -1) {
this.channelLinkedin.splice(index, 1);
}
this.socialAccountFacadeService.dispatchUpdatedSocailAccount();
//this.getSocialNetwork();
this.closeModal(id);
Expand All @@ -566,12 +584,19 @@ goToAccount(oracle: string, userName: string) {
.pipe(takeUntil(this.isDestroyed))
.subscribe((response: any) => {
if (response.message === 'deleted successfully') {
const index = this.channelTiktok.findIndex((ch: {
_id: string;
}) => ch._id === id);
if (index !== -1) {
this.channelTiktok.splice(index, 1);
}
this.socialAccountFacadeService.dispatchUpdatedSocailAccount();
//this.getSocialNetwork();
this.closeModal(id);
}
});
}
}

}

deleteList(modalName: any, network: string) {
Expand Down

0 comments on commit 854d03e

Please sign in to comment.