Misc fixes

This commit is contained in:
Natsumi
2025-07-22 01:53:48 +12:00
parent 4fd898d84d
commit b9b0cebd7f
11 changed files with 53 additions and 49 deletions

View File

@@ -8,17 +8,17 @@ import { convertFileUrlToImageUrl } from './common';
/**
*
* @param {object} ctx
* @returns {number}
* @returns {string?}
*/
function userOnlineForTimestamp(ctx) {
if (ctx.ref.state === 'online' && ctx.ref.$online_for) {
return ctx.ref.$online_for;
return new Date(ctx.ref.$online_for).toJSON();
} else if (ctx.ref.state === 'active' && ctx.ref.$active_for) {
return ctx.ref.$active_for;
return new Date(ctx.ref.$active_for).toJSON();
} else if (ctx.ref.$offline_for) {
return ctx.ref.$offline_for;
return new Date(ctx.ref.$offline_for).toJSON();
}
return 0;
return null;
}
/**