From 5a23927e5634c111512c1eb567a91b6a33c2d022 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 9 Mar 2018 10:09:36 +0000 Subject: [PATCH] Move comment up --- src/crypto/DeviceList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/DeviceList.js b/src/crypto/DeviceList.js index f0c0c7525..fa55f2fa6 100644 --- a/src/crypto/DeviceList.js +++ b/src/crypto/DeviceList.js @@ -163,6 +163,8 @@ export default class DeviceList { */ async saveIfDirty(delay) { if (!this._dirty) return Promise.resolve(false); + // Delay saves for a bit so we can aggregate multiple saves that happen + // in quick succession (eg. when a whole room's devices are marked as known) if (delay === undefined) delay = 500; const targetTime = Date.now + delay; @@ -185,8 +187,6 @@ export default class DeviceList { } if (this._saveTimer === null) { - // Delay saves for a bit so we can aggregate multiple saves that happen - // in quick succession (eg. when a whole room's devices are marked as known) const resolveSavePromise = this._resolveSavePromise; this._savePromiseTime = targetTime; this._saveTimer = setTimeout(() => {