Remove delete-channel from webapp
This commit is contained in:
@@ -15,19 +15,6 @@
|
||||
<span nz-icon nzType="edit"></span>
|
||||
Edit
|
||||
</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>
|
||||
|
||||
@@ -62,8 +62,6 @@ export class ChannelDetailComponent implements OnInit {
|
||||
subscriptions = signal<Subscription[]>([]);
|
||||
loading = signal(true);
|
||||
loadingSubscriptions = signal(false);
|
||||
deleting = signal(false);
|
||||
|
||||
// Edit modal
|
||||
showEditModal = signal(false);
|
||||
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
|
||||
regenerateSubscribeKey(): void {
|
||||
const channel = this.channel();
|
||||
|
||||
Reference in New Issue
Block a user