Skip to content

Commit

Permalink
Merge pull request #125 from HeyItsDanny/patch-4
Browse files Browse the repository at this point in the history
Update guilds.ejs: fix site refresh after guild invite
  • Loading branch information
iMidnights authored Sep 30, 2024
2 parents 1f1de05 + 18abdbd commit b0265b7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions views/guilds.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@
else icon = icon + "?size=256"
%>
<!--href="../invite?g=<%- req.session.guilds[i].id %>"-->
<a onclick="const newWindow = window.open(`/invite?g=<%- req.session.guilds[i].id %><%- config.invite?.redirectUri ? `&redirect=${config.invite.redirectUri.replace('{SERVER}', req.session.guilds[i].id)}` : '' %>`, 'Add bot to guild', 'scrollbars=no, resizable=no, status=no, location=no, toolbar=no, menubar=no, width=500, height=800'); checkRefresh()">
<a onclick="const newWindow = window.open(`/invite?g=<%- req.session.guilds[i].id %><%- config.invite?.redirectUri ? `&redirect=${config.invite.redirectUri.replace('{SERVER}', req.session.guilds[i].id)}` : '' %>`, 'Add bot to guild', 'scrollbars=no, resizable=no, status=no, location=no, toolbar=no, menubar=no, width=500, height=800'); checkRefresh(newWindow)">
<div max="20" scale="110" perspective="700" class="_82d1"
data-guildname="<%- req.session.guilds[i].name %>"
style="background-image: url(&quot;<%- icon %>&quot;); filter: grayscale(1);"></div>
</a>
<% } } } %>
<script>
function checkRefresh() {
setInterval(() => {
if (newWindow.closed) location.reload();
function checkRefresh(popup) {
const interval = setInterval(() => {
if (popup.closed) {
clearInterval(interval);
location.reload();
}
}, 500);
}
</script>
Expand Down

0 comments on commit b0265b7

Please sign in to comment.