Fix initial channel creation bug in frontend

This commit is contained in:
2024-08-23 22:32:58 +02:00
parent 448e25de50
commit 041ad18a6d
2 changed files with 6 additions and 2 deletions

View File

@@ -162,7 +162,11 @@ export class MainView extends View {
if (state.defaultChannelId) {
this.switchChannel(state.defaultChannelId.toString());
} else {
this.switchChannel(state.channelList.channels[0].id.toString());
if (state.channelList.channels.length > 0) {
this.switchChannel(state.channelList.channels[0].id.toString());
} else {
this.createNewChannel();
}
}
}
state.save();