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) {
|
createBuffer(serverID, name) {
|
||||||
let client = this.clients.get(serverID);
|
let client = this.clients.get(serverID);
|
||||||
let id = null;
|
let id = null;
|
||||||
|
let isNew = false;
|
||||||
this.setState((state) => {
|
this.setState((state) => {
|
||||||
let updated;
|
let updated;
|
||||||
[id, updated] = State.createBuffer(state, name, serverID, client);
|
[id, updated] = State.createBuffer(state, name, serverID, client);
|
||||||
|
isNew = !!updated;
|
||||||
return updated;
|
return updated;
|
||||||
});
|
});
|
||||||
|
if (isNew) {
|
||||||
this.syncBufferUnread(serverID, name);
|
this.syncBufferUnread(serverID, name);
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue