Improve MisskeyPages

This commit is contained in:
syuilo 2019-05-10 14:18:18 +09:00
parent 0bd92bf0bd
commit 079b75f3ed
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,7 @@ export class ASEvaluator {
VERSION: opts.version,
URL: opts.page ? `${opts.url}/@${opts.page.user.username}/pages/${opts.page.name}` : '',
LOGIN: opts.visitor != null,
NAME: opts.visitor ? opts.visitor.name : '',
NAME: opts.visitor ? opts.visitor.name || opts.visitor.username : '',
USERNAME: opts.visitor ? opts.visitor.username : '',
USERID: opts.visitor ? opts.visitor.id : '',
NOTES_COUNT: opts.visitor ? opts.visitor.notesCount : 0,
@ -42,7 +42,8 @@ export class ASEvaluator {
MY_FOLLOWERS_COUNT: opts.user ? opts.user.followersCount : 0,
MY_FOLLOWING_COUNT: opts.user ? opts.user.followingCount : 0,
SEED: opts.randomSeed ? opts.randomSeed : '',
YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`,
NULL: null
};
}

View File

@ -127,6 +127,7 @@ export const envVarsDef: Record<string, Type> = {
MY_FOLLOWING_COUNT: 'number',
SEED: null,
YMD: 'string',
NULL: null,
};
export function isLiteralBlock(v: Block) {