diff --git a/src/maps/Servers.ts b/src/maps/Servers.ts index 5d917a05..fcdb4427 100644 --- a/src/maps/Servers.ts +++ b/src/maps/Servers.ts @@ -102,9 +102,8 @@ export class Server { channels, }; - if (cat.id === 'default') { - if (channels.length === 0) - continue; + if (cat.id === "default") { + if (channels.length === 0) continue; defaultCategory = cat; } @@ -121,7 +120,7 @@ export class Server { if (defaultCategory) { defaultCategory.channels = [ ...defaultCategory.channels, - ...channels + ...channels, ]; } else { elements.unshift({ @@ -135,6 +134,14 @@ export class Server { return elements; } + /** + * Get the default channel for this server + */ + @computed get defaultChannel(): Channel | undefined { + return this.orderedChannels.find((cat) => cat.channels.length) + ?.channels[0]; + } + /** * Get an ordered array of roles with their IDs attached. * The highest ranking roles will be first followed by lower