Browse Source

fix(Station page): /:station-id should automatically be changed to /:station-name

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 năm trước cách đây
mục cha
commit
5a0c46e0d7

+ 6 - 0
frontend/src/pages/Station/index.vue

@@ -1452,6 +1452,12 @@ export default {
 						theme
 						theme
 					} = res.data;
 					} = res.data;
 
 
+					// change url to use station name instead of station id
+					if (name !== this.stationIdentifier) {
+						// eslint-disable-next-line no-restricted-globals
+						history.pushState({}, null, name);
+					}
+
 					this.joinStation({
 					this.joinStation({
 						_id,
 						_id,
 						name,
 						name,