diff --git a/index.html b/index.html
index abc042ea..fecbdd50 100644
--- a/index.html
+++ b/index.html
@@ -1,6 +1,7 @@
+
diff --git a/src/components/LoginPage.vue b/src/components/LoginPage.vue
index 72c111c2..f3fa1106 100644
--- a/src/components/LoginPage.vue
+++ b/src/components/LoginPage.vue
@@ -49,7 +49,7 @@ export default {
mounted() {
//TODO: Add Server Side check
if (this.getAuthToken()) {
- this.$router.push("/");
+ this.$router.push(import.meta.env.BASE_URL);
}
},
activated() {
@@ -67,7 +67,7 @@ export default {
}).then(resp => {
if (resp.token) {
this.setPreference("authToken" + this.hashCode(this.authApiUrl()), resp.token);
- window.location = "/"; // done to bypass cache
+ window.location = import.meta.env.BASE_URL; // done to bypass cache
} else alert(resp.error);
});
},
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index df3fdaff..dffdc7d0 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -131,7 +131,7 @@ export default {
searchText: "",
suggestionsVisible: false,
showTopNav: false,
- homePagePath: "/",
+ homePagePath: import.meta.env.BASE_URL,
registrationDisabled: false,
};
},
diff --git a/src/components/PageNotFound.vue b/src/components/PageNotFound.vue
index e1dc267a..d3b458eb 100644
--- a/src/components/PageNotFound.vue
+++ b/src/components/PageNotFound.vue
@@ -1,7 +1,11 @@
+
+
diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue
index 7b271a9e..babed6d2 100644
--- a/src/components/PreferencesPage.vue
+++ b/src/components/PreferencesPage.vue
@@ -655,14 +655,14 @@ export default {
// reset the auth token
localStorage.removeItem("authToken" + this.hashCode(this.authApiUrl()));
// redirect to trending page
- window.location = "/";
+ window.location = import.meta.env.BASE_URL;
},
resetPreferences() {
this.showConfirmResetPrefsDialog = false;
// clear the local storage
localStorage.clear();
// redirect to the home page
- window.location = "/";
+ window.location = import.meta.env.BASE_URL;
},
async invalidateSession() {
this.fetchJson(this.authApiUrl() + "/logout", null, {
diff --git a/src/components/RegisterPage.vue b/src/components/RegisterPage.vue
index 89dce364..d146e820 100644
--- a/src/components/RegisterPage.vue
+++ b/src/components/RegisterPage.vue
@@ -81,7 +81,7 @@ export default {
mounted() {
//TODO: Add Server Side check
if (this.getAuthToken()) {
- this.$router.push("/");
+ this.$router.push(import.meta.env.BASE_URL);
}
},
activated() {
@@ -107,7 +107,7 @@ export default {
}).then(resp => {
if (resp.token) {
this.setPreference("authToken" + this.hashCode(this.authApiUrl()), resp.token);
- window.location = "/"; // done to bypass cache
+ window.location = import.meta.env.BASE_URL; // done to bypass cache
} else alert(resp.error);
});
},
diff --git a/src/components/TrendingPage.vue b/src/components/TrendingPage.vue
index f50042db..34d0bf22 100644
--- a/src/components/TrendingPage.vue
+++ b/src/components/TrendingPage.vue
@@ -23,7 +23,12 @@ export default {
};
},
mounted() {
- if (this.$route.path == "/" && this.getPreferenceString("homepage", "trending") == "feed") return;
+ if (
+ this.$route.path == import.meta.env.BASE_URL &&
+ this.getPreferenceString("homepage", "trending") == "feed"
+ ) {
+ return;
+ }
let region = this.getPreferenceString("region", "US");
this.fetchTrending(region).then(videos => {
@@ -35,7 +40,7 @@ export default {
activated() {
document.title = this.$t("titles.trending") + " - Piped";
if (this.videos.length > 0) this.updateWatched(this.videos);
- if (this.$route.path == "/") {
+ if (this.$route.path == import.meta.env.BASE_URL) {
let homepage = this.getHomePage(this);
if (homepage !== undefined) this.$router.push(homepage);
}