mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-15 03:35:10 -05:00
Narrow down syncBufferUnread to new buffers
syncBufferUnread might override the previous unread value. Closes: https://todo.sr.ht/~emersion/gamja/105
This commit is contained in:
parent
1dd55367e9
commit
65674cb45d
1 changed files with 5 additions and 1 deletions
|
@ -281,12 +281,16 @@ export default class App extends Component {
|
|||
createBuffer(serverID, name) {
|
||||
let client = this.clients.get(serverID);
|
||||
let id = null;
|
||||
let isNew = false;
|
||||
this.setState((state) => {
|
||||
let updated;
|
||||
[id, updated] = State.createBuffer(state, name, serverID, client);
|
||||
isNew = !!updated;
|
||||
return updated;
|
||||
});
|
||||
this.syncBufferUnread(serverID, name);
|
||||
if (isNew) {
|
||||
this.syncBufferUnread(serverID, name);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue