mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
store: add note about comparison in Buffer.put
This commit is contained in:
parent
2ac7be6218
commit
a3eec9a351
1 changed files with 2 additions and 0 deletions
2
store.js
2
store.js
|
@ -87,6 +87,8 @@ export class Buffer {
|
||||||
let receipts = { ...prev.receipts };
|
let receipts = { ...prev.receipts };
|
||||||
if (buf.receipts) {
|
if (buf.receipts) {
|
||||||
Object.keys(buf.receipts).forEach((k) => {
|
Object.keys(buf.receipts).forEach((k) => {
|
||||||
|
// Use a not-equals comparison here so that no-op receipt
|
||||||
|
// changes are correctly handled
|
||||||
if (!receipts[k] || receipts[k].time < buf.receipts[k].time) {
|
if (!receipts[k] || receipts[k].time < buf.receipts[k].time) {
|
||||||
receipts[k] = buf.receipts[k];
|
receipts[k] = buf.receipts[k];
|
||||||
updated = true;
|
updated = true;
|
||||||
|
|
Loading…
Reference in a new issue