Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update guilds.ejs: fix site refresh after guild invite #125

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading