Use env.request.resource for instance switch link

This commit is contained in:
syeopite 2021-10-15 14:40:59 -07:00
parent a531f4f057
commit 437bdedb07
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
5 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@
<% if env.get("preferences").as(Preferences).automatic_instance_redirect%> <% if env.get("preferences").as(Preferences).automatic_instance_redirect%>
<a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% else %> <% else %>
<a href="https://redirect.invidious.io/<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="https://redirect.invidious.io<%= env.request.path %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% end %> <% end %>
</div> </div>
<% if !channel.auto_generated %> <% if !channel.auto_generated %>

View File

@ -47,7 +47,7 @@
<% if env.get("preferences").as(Preferences).automatic_instance_redirect%> <% if env.get("preferences").as(Preferences).automatic_instance_redirect%>
<a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% else %> <% else %>
<a href="https://redirect.invidious.io/<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="https://redirect.invidious.io<%= env.request.resource %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% end %> <% end %>
</div> </div>
<% if !channel.auto_generated %> <% if !channel.auto_generated %>

View File

@ -47,7 +47,7 @@
<%= translate(locale, "Switch Invidious Instance") %> <%= translate(locale, "Switch Invidious Instance") %>
</a> </a>
<% else %> <% else %>
<a href="https://redirect.invidious.io/<%= env.get?("current_page") %>"> <a href="https://redirect.invidious.io<%= env.request.resource %>">
<%= translate(locale, "Switch Invidious Instance") %> <%= translate(locale, "Switch Invidious Instance") %>
</a> </a>
<% end %> <% end %>

View File

@ -50,7 +50,7 @@
<% if env.get("preferences").as(Preferences).automatic_instance_redirect%> <% if env.get("preferences").as(Preferences).automatic_instance_redirect%>
<a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% else %> <% else %>
<a href="https://redirect.invidious.io/<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="https://redirect.invidious.io<%= env.request.resource %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% end %> <% end %>
</div> </div>

View File

@ -119,7 +119,7 @@ we're going to need to do it here in order to allow for translations.
<% if env.get("preferences").as(Preferences).automatic_instance_redirect%> <% if env.get("preferences").as(Preferences).automatic_instance_redirect%>
<a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% else %> <% else %>
<a href="https://redirect.invidious.io/<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> <a href="https://redirect.invidious.io<%= env.request.resource %>"><%= translate(locale, "Switch Invidious Instance") %></a>
<% end %> <% end %>
</p> </p>
<p id="embed-link"> <p id="embed-link">