Fix saving last user agent and browser id

This commit is contained in:
Terncode committed 2026-11-17 18:09:23 +01:00
1 parent 3e7c673edd
commit cc5232030f
1 file changed
+3 -1
+3 -1
View File
@@ -4,6 +4,7 @@ import { offline, hash, handleJSON } from '../requestUtils';
import { createGetAccountData } from '../api/account';
import { Settings, ServerConfig } from '../../common/adminInterfaces';
import { includes } from '../../common/utils';
import { logger } from '../logger';
const blockApps: string[] = [];
const MAX_CONCURRENT_REQUESTS = 100;
@@ -26,7 +27,8 @@ export default function (server: ServerConfig, settings: Settings) {
(lastBrowserId && account.lastBrowserId !== lastBrowserId)) {
account.lastUserAgent = lastUserAgent;
account.lastBrowserId = lastBrowserId;
Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId });
Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId }).exec()
.catch(e => logger.error(e));
}
return await getAccountData(account);