Skip to content

Commit

Permalink
Resolves #269
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaisslaying committed Mar 13, 2024
1 parent 29b438d commit 708e8ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
20 changes: 19 additions & 1 deletion src/Routes/bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,15 @@ router.get(
req: req
});

if (bot.status.approved === false)
return res.status(400).render("status", {
title: res.__("common.error"),
status: 400,
subtitle: res.__("common.error.bot.inQueueHide"),
req,
type: "Error"
});

discord.channels.logs.send(
`${settings.emoji.hide} **${functions.escapeFormatting(
req.user.db.fullUsername
Expand Down Expand Up @@ -3704,6 +3713,15 @@ router.get(
type: "Error"
});

if (bot.status.approved === false)
return res.status(400).render("status", {
title: res.__("common.error"),
status: 400,
subtitle: res.__("common.error.bot.inQueueHide"),
req,
type: "Error"
});

res.locals.premidPageInfo = res.__("premid.bots.hide", bot.name);

res.render("templates/bots/staffActions/remove", {
Expand Down Expand Up @@ -3739,7 +3757,7 @@ router.post(
return res.status(400).render("status", {
title: res.__("common.error"),
status: 400,
subtitle: res.__("common.error.bot.inQueue"),
subtitle: res.__("common.error.bot.inQueueHide"),
req,
type: "Error"
});
Expand Down
8 changes: 4 additions & 4 deletions views/templates/bots/view.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
</div>
</div>
</div>
<% if (bot.status.hidden) { %>
<% if (bot.status.hidden && bot.status.approved) { %>
<%-
include("../../partials/button.ejs", {
className: "button is-white",
Expand Down Expand Up @@ -273,14 +273,14 @@
<span><%= __("common.edit") %></span>
</a>
<% } %>
<% if (!bot.status.modHidden) { %>
<% if (!bot.status.modHidden && bot.status.approved) { %>
<a class="dropdown-item has-text-grey-light" href="<%= linkPrefix %>/bots/<%= bot._id %>/modhide">
<span class="icon">
<i aria-hidden="true" class="fas fa-eye-slash"></i>
</span>
<span><%= __("common.hide") %></span>
</a>
<% } else { %>
<% } else if (bot.status.approved) { %>
<a class="dropdown-item has-text-grey-light" href="<%= linkPrefix %>/bots/<%= bot._id %>/modunhide">
<span class="icon">
<i aria-hidden="true" class="fas fa-eye"></i>
Expand Down Expand Up @@ -653,7 +653,7 @@
</span>
<span><%= __("common.archive") %></span>
</a>
<a class="button is-white" style="background-color: #b5b5b5" <% if (!bot.status.hidden && !bot.status.modHidden) { %>href="<%= linkPrefix %>/bots/<%= bot._id %>/hide"<% } else { %>disabled<% } %>>
<a class="button is-white" style="background-color: #b5b5b5" <% if (!bot.status.hidden && !bot.status.modHidde && bot.status.approved) { %>href="<%= linkPrefix %>/bots/<%= bot._id %>/hide"<% } else { %>disabled<% } %>>
<span class="icon">
<i aria-hidden="true" class="fas fa-eye-slash"></i>
</span>
Expand Down

0 comments on commit 708e8ba

Please sign in to comment.