From 1d1fc8792005a15af4e79194623d4343fbf29375 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Feb 2020 11:35:49 +0900 Subject: [PATCH] Fix bug --- CHANGELOG.md | 6 +++--- src/client/components/page/page.vue | 1 - src/client/scripts/aiscript/evaluator.ts | 5 +---- src/client/scripts/aiscript/index.ts | 3 --- src/models/repositories/page.ts | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd7abf53..b7649cd02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ Misskey v12では、クライアントが設計し直され、全く新しいUI * ノートに位置情報を添付できる機能を廃止 * ノートに何のアプリから投稿したかという情報を含めるのを廃止 * Meta APIでサーバー内部の情報(マシン名、CPU情報など)を含めるのを廃止 +* Pages: MY_NOTES_COUNT 変数を廃止 +* Pages: MY_FOLLOWERS_COUNT 変数を廃止 +* Pages: MY_FOLLOWING_COUNT 変数を廃止 ### ✨Improvements * Webクライアントを一新 @@ -90,9 +93,6 @@ Misskey v12では、クライアントが設計し直され、全く新しいUI * TypeError: Cannot read property 'stack' of undefined が出ることがある問題を修正 * AP: audience (visibility) パースの修正 * Pages: VERSION 変数が常に null な問題を修正 -* Pages: MY_NOTES_COUNT 変数が常に null な問題を修正 -* Pages: MY_FOLLOWERS_COUNT 変数が常に null な問題を修正 -* Pages: MY_FOLLOWING_COUNT 変数が常に null な問題を修正 * Pages: DRPWPMが最初のしか出てこない問題を修正 11.37.1 (2020/01/07) diff --git a/src/client/components/page/page.vue b/src/client/components/page/page.vue index 4d62326a5..b8f6fd2f9 100644 --- a/src/client/components/page/page.vue +++ b/src/client/components/page/page.vue @@ -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 diff --git a/src/client/scripts/aiscript/evaluator.ts b/src/client/scripts/aiscript/evaluator.ts index cc1adf449..5cdf5e0b8 100644 --- a/src/client/scripts/aiscript/evaluator.ts +++ b/src/client/scripts/aiscript/evaluator.ts @@ -17,7 +17,7 @@ export class ASEvaluator { private envVars: Record; 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 diff --git a/src/client/scripts/aiscript/index.ts b/src/client/scripts/aiscript/index.ts index f2de1bb40..8e7b1f052 100644 --- a/src/client/scripts/aiscript/index.ts +++ b/src/client/scripts/aiscript/index.ts @@ -125,9 +125,6 @@ export const envVarsDef: Record = { 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, diff --git a/src/models/repositories/page.ts b/src/models/repositories/page.ts index 0ebd07267..cff42ddef 100644 --- a/src/models/repositories/page.ts +++ b/src/models/repositories/page.ts @@ -65,7 +65,7 @@ export class PageRepository extends Repository { 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,