Skip to content

Commit

Permalink
move is_mod out of the conversations loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjwebb committed Dec 8, 2023
1 parent ca7a005 commit f3cd31a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7714,6 +7714,8 @@ async function handle_GET_conversations(
return;
}

const is_mod = uid && isAdministrator(uid);

conversationsResult.forEach(function (conv) {
conv.created = Number(conv.created);
conv.modified = Number(conv.modified);
Expand All @@ -7723,7 +7725,7 @@ async function handle_GET_conversations(
conv.topic = new Date(conv.created).toUTCString();
}

conv.is_mod = uid && isAdministrator(uid);
conv.is_mod = is_mod;

if(conv.github_pr_id !== null) {
conv.github_pr_url = `https://github.com/${process.env.FIP_REPO_OWNER}/${process.env.FIP_REPO_NAME}/pull/${conv.github_pr_id}/files`;
Expand Down

0 comments on commit f3cd31a

Please sign in to comment.