diff --git a/src/components/Main.vue b/src/components/Main.vue
index 5752541..f1e26b0 100644
--- a/src/components/Main.vue
+++ b/src/components/Main.vue
@@ -36,7 +36,8 @@
+ :sidebar-station="sidebarStation"
+ @toggleSidebar="toggleSidebar" />
@@ -332,9 +333,13 @@ export default {
})
},
- toggleSidebar(station) {
- this.showSidebar = true
- this.sidebarStation = station
+ toggleSidebar(station = null) {
+ if (station) {
+ this.showSidebar = true
+ this.sidebarStation = station
+ } else {
+ this.showSidebar = false
+ }
},
},
}
diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue
index f775ca8..9300ba5 100644
--- a/src/components/Sidebar.vue
+++ b/src/components/Sidebar.vue
@@ -5,7 +5,7 @@
:subtitle="stationTags"
:background="sidebarStation.favicon"
class="has-preview"
- @close="showSidebar=false">
+ @close="toggleSidebar">
@@ -90,6 +90,11 @@ export default {
return ''
},
},
+ methods: {
+ toggleSidebar(station) {
+ this.$emit('toggleSidebar')
+ },
+ },
}