Fix bug
This commit is contained in:
@ -69,7 +69,6 @@ export default Vue.extend({
|
||||
const pageVars = this.getPageVars();
|
||||
this.script = new Script(this.page, new ASEvaluator(this.page.variables, pageVars, {
|
||||
randomSeed: Math.random(),
|
||||
user: this.page.user,
|
||||
visitor: this.$store.state.i,
|
||||
page: this.page,
|
||||
url: url
|
||||
|
@ -17,7 +17,7 @@ export class ASEvaluator {
|
||||
private envVars: Record<keyof typeof envVarsDef, any>;
|
||||
|
||||
private opts: {
|
||||
randomSeed: string; user?: any; visitor?: any; page?: any; url?: string;
|
||||
randomSeed: string; visitor?: any; page?: any; url?: string;
|
||||
};
|
||||
|
||||
constructor(variables: Variable[], pageVars: PageVar[], opts: ASEvaluator['opts']) {
|
||||
@ -39,9 +39,6 @@ export class ASEvaluator {
|
||||
FOLLOWERS_COUNT: opts.visitor ? opts.visitor.followersCount : 0,
|
||||
FOLLOWING_COUNT: opts.visitor ? opts.visitor.followingCount : 0,
|
||||
IS_CAT: opts.visitor ? opts.visitor.isCat : false,
|
||||
MY_NOTES_COUNT: opts.user ? opts.user.notesCount : 0,
|
||||
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()}`,
|
||||
NULL: null
|
||||
|
@ -125,9 +125,6 @@ export const envVarsDef: Record<string, Type> = {
|
||||
FOLLOWERS_COUNT: 'number',
|
||||
FOLLOWING_COUNT: 'number',
|
||||
IS_CAT: 'boolean',
|
||||
MY_NOTES_COUNT: 'number',
|
||||
MY_FOLLOWERS_COUNT: 'number',
|
||||
MY_FOLLOWING_COUNT: 'number',
|
||||
SEED: null,
|
||||
YMD: 'string',
|
||||
NULL: null,
|
||||
|
@ -65,7 +65,7 @@ export class PageRepository extends Repository<Page> {
|
||||
createdAt: page.createdAt.toISOString(),
|
||||
updatedAt: page.updatedAt.toISOString(),
|
||||
userId: page.userId,
|
||||
user: Users.pack(page.user || page.userId, me, { detail: true }),
|
||||
user: Users.pack(page.user || page.userId, me), // { detail: true } すると無限ループするので注意
|
||||
content: page.content,
|
||||
variables: page.variables,
|
||||
title: page.title,
|
||||
|
Reference in New Issue
Block a user