diff --git a/CHANGELOG.md b/CHANGELOG.md index b8e6034f2f..96fc1cb300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ UIからアプリを作成する画面 (`/dev/apps`) は廃止されました、 12.21.0 (2020/02/23) ------------------- ### ✨Improvements +* タイムラインに挿入されるおすすめノートに自分がリアクションしたものは含めないように * ノートのメニューに詳細ページへのリンクを追加 * UIの調整 diff --git a/src/server/api/common/signup.ts b/src/server/api/common/signup.ts index b6e13b36f1..26a9d03e0f 100644 --- a/src/server/api/common/signup.ts +++ b/src/server/api/common/signup.ts @@ -22,8 +22,6 @@ export async function signup(username: User['username'], password: UserProfile[' throw new Error('INVALID_PASSWORD'); } - const usersCount = await Users.count({}); - // Generate hash of password const salt = await bcrypt.genSalt(8); const hash = await bcrypt.hash(password, salt); @@ -76,7 +74,9 @@ export async function signup(username: User['username'], password: UserProfile[' usernameLower: username.toLowerCase(), host: toPunyNullable(host), token: secret, - isAdmin: usersCount === 0, + isAdmin: (await Users.count({ + host: null, + })) === 0, })); await transactionalEntityManager.save(new UserKeypair({ diff --git a/src/server/api/endpoints/admin/accounts/create.ts b/src/server/api/endpoints/admin/accounts/create.ts index 16fe3e36da..98e5642bed 100644 --- a/src/server/api/endpoints/admin/accounts/create.ts +++ b/src/server/api/endpoints/admin/accounts/create.ts @@ -17,7 +17,9 @@ export const meta = { }; export default define(meta, async (ps, me) => { - const noUsers = (await Users.count({})) === 0; + const noUsers = (await Users.count({ + host: null, + })) === 0; if (!noUsers && !me?.isAdmin) throw new Error('access denied'); const { account, secret } = await signup(ps.username, ps.password); diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 41adc855d2..0cb6f75f11 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -137,7 +137,9 @@ export default define(meta, async (ps, me) => { category: e.category, url: e.url, })), - requireSetup: (await Users.count({})) === 0, + requireSetup: (await Users.count({ + host: null, + })) === 0, enableEmail: instance.enableEmail, enableTwitterIntegration: instance.enableTwitterIntegration,