Remove delete-channel from webapp
This commit is contained in:
@@ -15,19 +15,6 @@
|
|||||||
<span nz-icon nzType="edit"></span>
|
<span nz-icon nzType="edit"></span>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
nz-button
|
|
||||||
nzType="primary"
|
|
||||||
nzDanger
|
|
||||||
nz-popconfirm
|
|
||||||
nzPopconfirmTitle="Are you sure you want to delete this channel? All messages and subscriptions will be lost."
|
|
||||||
nzPopconfirmPlacement="bottomRight"
|
|
||||||
(nzOnConfirm)="deleteChannel()"
|
|
||||||
[nzLoading]="deleting()"
|
|
||||||
>
|
|
||||||
<span nz-icon nzType="delete"></span>
|
|
||||||
Delete
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ export class ChannelDetailComponent implements OnInit {
|
|||||||
subscriptions = signal<Subscription[]>([]);
|
subscriptions = signal<Subscription[]>([]);
|
||||||
loading = signal(true);
|
loading = signal(true);
|
||||||
loadingSubscriptions = signal(false);
|
loadingSubscriptions = signal(false);
|
||||||
deleting = signal(false);
|
|
||||||
|
|
||||||
// Edit modal
|
// Edit modal
|
||||||
showEditModal = signal(false);
|
showEditModal = signal(false);
|
||||||
editDisplayName = '';
|
editDisplayName = '';
|
||||||
@@ -173,24 +171,6 @@ export class ChannelDetailComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete channel
|
|
||||||
deleteChannel(): void {
|
|
||||||
const channel = this.channel();
|
|
||||||
const userId = this.authService.getUserId();
|
|
||||||
if (!channel || !userId) return;
|
|
||||||
|
|
||||||
this.deleting.set(true);
|
|
||||||
this.apiService.deleteChannel(userId, channel.channel_id).subscribe({
|
|
||||||
next: () => {
|
|
||||||
this.notification.success('Channel deleted');
|
|
||||||
this.router.navigate(['/channels']);
|
|
||||||
},
|
|
||||||
error: () => {
|
|
||||||
this.deleting.set(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Regenerate keys
|
// Regenerate keys
|
||||||
regenerateSubscribeKey(): void {
|
regenerateSubscribeKey(): void {
|
||||||
const channel = this.channel();
|
const channel = this.channel();
|
||||||
|
|||||||
Reference in New Issue
Block a user