core: 修复总是显示用户当前离线的问题

This commit is contained in:
undefined committed 2021-02-22 00:46:26 +08:00
1 parent f9aef434cb
commit de908236e3
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.17.17",
"version": "2.17.18",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
@@ -61,4 +61,4 @@
"build": "tsc",
"build:watch": "tsc --watch"
}
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ export function getSessionListByUid(uid: number) {
}
export async function getMostRecentSessionByUid(uid: number) {
const res = await coll.find({ uid, tokenType: TYPE_SESSION }).sort('updateAt', -1);
const res = await coll.find({ uid, tokenType: TYPE_SESSION }).sort('updateAt', -1).toArray();
return res[0];
}