summaryrefslogtreecommitdiff
path: root/priv/discord_activity.html.eex
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-07-28 19:40:14 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-07-28 19:48:19 +0000
commit78808161c6b8726be5e18427a5da4328ab1fa26f (patch)
treec7911b740ce98ad250937122dd62ba941856da98 /priv/discord_activity.html.eex
parentcfa9a1c331c0f4912107434b185d3f9157044638 (diff)
downloadmediasync-78808161c6b8726be5e18427a5da4328ab1fa26f.tar
mediasync-78808161c6b8726be5e18427a5da4328ab1fa26f.tar.gz
mediasync-78808161c6b8726be5e18427a5da4328ab1fa26f.zip
Refactor
Diffstat (limited to 'priv/discord_activity.html.eex')
-rw-r--r--priv/discord_activity.html.eex10
1 files changed, 6 insertions, 4 deletions
diff --git a/priv/discord_activity.html.eex b/priv/discord_activity.html.eex
index 5cb8a68..cfdba73 100644
--- a/priv/discord_activity.html.eex
+++ b/priv/discord_activity.html.eex
@@ -1,5 +1,8 @@
-<% home_url="/.proxy/?#{Mediasync.Constants.query_param_discord_activity_inner()}" %>
<!DOCTYPE html>
+<%
+import Mediasync.Constants
+home_url="/.proxy/?#{query_param_discord_activity_inner()}"
+%>
<html lang="en">
<head>
@@ -72,15 +75,14 @@
<span style="font-weight: bold;">currently hosting:</span>
<div id="instance-room-info-content"></div>
</div>
- </div>
<iframe src="<%= home_url %>" style="display: none;" class="at-home" name="activity-inner-iframe"></iframe>
<script>
- const QUERY_PARAM_DISCORD_ACTIVITY_INNER = "<%= Mediasync.Constants.query_param_discord_activity_inner() %>";
+ const QUERY_PARAM_DISCORD_ACTIVITY_INNER = "<%= query_param_discord_activity_inner() %>";
const DISCORD_CLIENT_ID = "<%= Application.fetch_env!(:mediasync, :discord_client_id) %>";
const ACCESS_TOKEN_URL = `/.proxy/discord_activity/access_token?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}`;
const HOME_URL = "<%= home_url %>";
const roomsForInstanceUrl = (instanceId) => {
- return `/.proxy/discord_activity/rooms_for_instance?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}&instance_id=${instanceId}`;
+ return `/.proxy/discord_activity/rooms_for_instance?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}&<%= query_param_instance_id() %>=${instanceId}`;
};
const roomUrl = (roomId) => {
return `/.proxy/room/${roomId}?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}`;