Fix friends list stops updating

How?
This commit is contained in:
Samuel Elliott 2022-08-13 00:39:27 +01:00
parent 5f0fd26ef6
commit 0e7b6e50c4
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -93,8 +93,10 @@ export class CoralUser<T extends CoralApi = CoralApi> implements CoralUserData<T
if ((this.updated[key] + ttl) < Date.now()) {
const promise = this.promise.get(key) ?? callback.call(null).then(() => {
this.updated[key] = Date.now();
}).finally(() => {
this.promise.delete(key);
}).catch(err => {
this.promise.delete(key);
throw err;
});
this.promise.set(key, promise);