mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
components/app: introduce updateDocumentTitle()
The logic in here will get more involved once we add unread counts and such.
This commit is contained in:
parent
9924f08794
commit
4d6f14ab0b
1 changed files with 10 additions and 5 deletions
|
@ -556,11 +556,7 @@ export default class App extends Component {
|
||||||
this.whoChannelBuffer(buf.name, buf.server);
|
this.whoChannelBuffer(buf.name, buf.server);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf.type !== BufferType.SERVER) {
|
this.updateDocumentTitle();
|
||||||
document.title = buf.name + ' · ' + this.baseTitle;
|
|
||||||
} else {
|
|
||||||
document.title = this.baseTitle;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: only mark as read if user scrolled at the bottom
|
// TODO: only mark as read if user scrolled at the bottom
|
||||||
|
@ -610,6 +606,15 @@ export default class App extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateDocumentTitle() {
|
||||||
|
let buf = State.getBuffer(this.state, this.state.activeBuffer);
|
||||||
|
if (buf && buf.type !== BufferType.SERVER) {
|
||||||
|
document.title = buf.name + ' · ' + this.baseTitle;
|
||||||
|
} else {
|
||||||
|
document.title = this.baseTitle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareChatMessage(serverID, msg) {
|
prepareChatMessage(serverID, msg) {
|
||||||
// Treat server-wide broadcasts as highlights. They're sent by server
|
// Treat server-wide broadcasts as highlights. They're sent by server
|
||||||
// operators and can contain important information.
|
// operators and can contain important information.
|
||||||
|
|
Loading…
Reference in a new issue