Add logging and fix channel merging and removing

This commit is contained in:
2024-08-24 00:21:54 +02:00
parent 7055713d4b
commit 3575c910f4
14 changed files with 163 additions and 7 deletions

View File

@@ -140,6 +140,21 @@ export class MainView extends View {
}
const d = new ChannelDialog(state.currentChannel!);
d.open().then((chan) => {
if (!chan) {
state.removeChannel(state.currentChannel!);
state.currentChannel = null;
this.updateChannelList();
state.save();
if (state.channelList.channels.length > 0) {
return this.switchChannel(state.channelList.channels[0].id.toString());
} else {
return this.createNewChannel();
}
}
if (chan.messages.length < 1) {
this.renderInitialMessageList(true);
this.syncMessages();
}
state.save();
this.updateChannelList();
});