Kaynağa Gözat

fix(ManageStation): non-admin/owner users couldn't close ManageStation

Kristian Vos 3 yıl önce
ebeveyn
işleme
6d9e4dd987

+ 3 - 2
frontend/src/components/modals/ManageStation/index.vue

@@ -545,8 +545,8 @@ export default {
 			() => {}
 		);
 
+		if (this.isOwnerOrAdmin()) this.showTab("settings");
 		this.clearStation();
-		this.showTab("settings");
 	},
 	methods: {
 		isOwner() {
@@ -643,7 +643,8 @@ export default {
 		]),
 		...mapActions({
 			showTab(dispatch, payload) {
-				this.$refs[`${payload}-tab`].scrollIntoView();
+				if (this.$refs[`${payload}-tab`])
+					this.$refs[`${payload}-tab`].scrollIntoView(); // Only works if the ref exists, which it doesn't always
 				return dispatch("modals/manageStation/showTab", payload);
 			}
 		}),