fix: 🐛 only verify if needed
This commit is contained in:
parent
6d7c5f2b2e
commit
34cfe9c15c
4 changed files with 11 additions and 5 deletions
|
@ -26,6 +26,7 @@ export async function verifyLinks(
|
|||
x.name !== "" &&
|
||||
typeof x.value === "string" &&
|
||||
x.value !== "" &&
|
||||
x.value.startsWith("http") &&
|
||||
((x.lastVerified &&
|
||||
x.lastVerified.getTime() < Date.now() - 1000 * 60 * 60 * 24 * 14) ||
|
||||
!x.lastVerified),
|
||||
|
|
|
@ -245,10 +245,13 @@ export default define(meta, paramDef, async (ps, _user, token) => {
|
|||
x.value !== "",
|
||||
)
|
||||
.map(async (x) => {
|
||||
const relMeLinks = await getRelMeLinks(x.value);
|
||||
const verified = relMeLinks.some((link) =>
|
||||
link.includes(`${config.host}/@${user.username}`),
|
||||
);
|
||||
let verified = false;
|
||||
if (x.value.startsWith("http")) {
|
||||
const relMeLinks = await getRelMeLinks(x.value);
|
||||
verified = relMeLinks.some((link) =>
|
||||
link.includes(`${config.host}/@${user.username}`),
|
||||
);
|
||||
}
|
||||
return {
|
||||
name: x.name,
|
||||
value: x.value,
|
||||
|
|
|
@ -294,10 +294,10 @@
|
|||
>
|
||||
<dt class="name">
|
||||
<i
|
||||
v-if="field.verified"
|
||||
class="ph-bold ph-seal-check ph-lg ph-fw"
|
||||
style="padding: 5px"
|
||||
:v-tooltip="i18n.ts.verifiedLink"
|
||||
:aria-label="i18n.t('verifiedLink')"
|
||||
></i>
|
||||
<Mfm
|
||||
:text="field.name"
|
||||
|
|
|
@ -2,5 +2,7 @@ namespace MisskeyEntity {
|
|||
export type Field = {
|
||||
name: string
|
||||
value: string
|
||||
verified?: string
|
||||
verifiedAt?: Date
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue