Generische URL zur Benutzer-Abrechnungsseite in Javascript funktioniert nicht

So I know already that /my/billing/subscriptions is a way to link the current user to his or her own user profile, in particular, the billing section that comes with Discourse Subscriptions. However, this doesn’t seem to be working in my code below, with the expression within the if-statement. In particular, I am trying to get a button to show up only on the user’s billing page. In fact, it seems to not work for any URL of the form /my, whether it’s billing, preferences, activity, or whatever else. Am I doing something wrong? What should I be using? (Keep in mind this is only not working in the if-statement. Otherwise using /my has and is working fine.)

<script type="text/discourse-plugin" version="0.8">
api.registerConnectorClass("above-user-profile", "back-button", {
    setupComponent(args, component) {
    api.onPageChange((url) => {

        if (url === "/my/billing/subscriptions" ){ 
          document.querySelector("html").classList.add("custom-homepage"); 
          component.set("displayCustomHomepage", true); 
        } else {  
          document.querySelector("html").classList.remove("custom-homepage"); 
          component.set("displayCustomHomepage", false); 
        }
    });
    }
});

</script>

<script type="text/x-handlebars" data-template-name="/connectors/above-user-profile/back-button">
  {{#if displayCustomHomepage}} 
    <a href="https://mathbymiles.com/my/preferences" class="btn btn-default">
        <span class="d-button-label">
            Go back to settings!
        </span>
    </a>
  {{/if}}
</script>
1 „Gefällt mir“