components/app: include bouncer network name in window title

Co-authored-by: sitting33 <me@sit.sh>
This commit is contained in:
Simon Ser 2024-04-25 16:34:05 +02:00
parent 4d6f14ab0b
commit 8faff95631

View file

@ -608,11 +608,25 @@ export default class App extends Component {
updateDocumentTitle() { updateDocumentTitle() {
let buf = State.getBuffer(this.state, this.state.activeBuffer); let buf = State.getBuffer(this.state, this.state.activeBuffer);
if (buf && buf.type !== BufferType.SERVER) { let server;
document.title = buf.name + ' · ' + this.baseTitle; if (buf) {
} else { server = this.state.servers.get(buf.server);
document.title = this.baseTitle;
} }
let bouncerNetwork;
if (server.bouncerNetID) {
bouncerNetwork = this.state.bouncerNetworks.get(server.bouncerNetID);
}
let parts = [];
if (buf && buf.type !== BufferType.SERVER) {
parts.push(buf.name);
}
if (bouncerNetwork) {
parts.push(getServerName(server, bouncerNetwork));
}
parts.push(this.baseTitle);
document.title = parts.join(" · ");
} }
prepareChatMessage(serverID, msg) { prepareChatMessage(serverID, msg) {