Browse Source

feat: stations now update the tab title to include the station title

Kristian Vos 5 years ago
parent
commit
61438d0a6e

+ 0 - 1
frontend/components/Station/CommunityHeader.vue

@@ -6,7 +6,6 @@
 					class="nav-item is-brand"
 					href="#"
 					:to="{ path: '/' }"
-					@click="this.$dispatch('leaveStation', title)"
 				>
 					Musare
 				</router-link>

+ 1 - 5
frontend/components/Station/OfficialHeader.vue

@@ -2,11 +2,7 @@
 	<div>
 		<nav class="nav">
 			<div class="nav-left">
-				<router-link
-					class="nav-item is-brand"
-					to="/"
-					@click="this.$dispatch('leaveStation', title)"
-				>
+				<router-link class="nav-item is-brand" to="/">
 					Musare
 				</router-link>
 			</div>

+ 3 - 0
frontend/components/Station/Station.vue

@@ -915,6 +915,9 @@ export default {
 						owner,
 						privatePlaylist
 					} = res.data;
+
+					document.title = `Musare - ${displayName}`;
+
 					_this.joinStation({
 						_id,
 						name: _this.stationName,

+ 4 - 2
frontend/main.js

@@ -107,8 +107,6 @@ lofig.get("serverDomain", function(res) {
 });
 
 router.beforeEach((to, from, next) => {
-	window.location.hash = "";
-
 	if (window.stationInterval) {
 		clearInterval(window.stationInterval);
 		window.stationInterval = 0;
@@ -123,6 +121,10 @@ router.beforeEach((to, from, next) => {
 		});
 	} else next();
 
+	if (from.name === "community" || from.name === "official") {
+		document.title = "Musare";
+	}
+
 	if (to.officialRequired) {
 		io.getSocket(socket => {
 			socket.emit("stations.findByName", to.params.id, res => {