Skip to content

Commit

Permalink
登録直後のユーザーにはおすすめユーザーを出さないように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jun 20, 2019
1 parent 51ed2f6 commit 2e9590d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/api/endpoints/users/recommendation.ts
Expand Up @@ -41,9 +41,19 @@ export const meta = {
};

export default define(meta, async (ps, me) => {
// 未ログインはエラーにはしないが空を返す
if (me == null) {
return [];
}

// 登録直後のユーザーだとタイムアウトしたり人気のユーザーと同じになったりするので空を返す
if (!(me.notesCount > 10 && me.followingCount > 10)) {
return [];
}

const instance = await fetchMeta();

if (instance.enableExternalUserRecommendation && me != null) {
if (instance.enableExternalUserRecommendation) {
const userName = me.username;
const hostName = config.hostname;
const limit = ps.limit;
Expand Down

0 comments on commit 2e9590d

Please sign in to comment.