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

@@ -12,6 +12,9 @@ import { parseLocation } from './location';
* @returns
*/
function checkCanInvite(location) {
if (!location) {
return false;
}
const userStore = useUserStore();
const locationStore = useLocationStore();
const instanceStore = useInstanceStore();
@@ -42,6 +45,9 @@ function checkCanInvite(location) {
* @returns
*/
function checkCanInviteSelf(location) {
if (!location) {
return false;
}
const userStore = useUserStore();
const instanceStore = useInstanceStore();
const friendStore = useFriendStore();

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;
}
/**