From 7f3bdc8de86a20ba6718429910ec1bda3f5baaff Mon Sep 17 00:00:00 2001 From: portree_kid Date: Tue, 7 Jan 2020 15:24:30 +0100 Subject: [PATCH] Fewer MUTATIONS of CENTER & BOUNDS --- src/renderer/components/FlightgearMap.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue index bb724ab..406556e 100644 --- a/src/renderer/components/FlightgearMap.vue +++ b/src/renderer/components/FlightgearMap.vue @@ -101,14 +101,20 @@ this.$store.commit('SET_EDIT_AIRPORT', item.properties) }, zoomUpdated (zoom) { - this.$store.dispatch('setZoom', zoom) - console.log(this.$refs.airportLayer.setVisible(zoom < 12)) + if (zoom !== this.$store.state.Settings.zoom) { + this.$store.dispatch('setZoom', zoom) + this.$refs.airportLayer.setVisible(zoom < 12) + } }, centerUpdated (center) { - this.$store.dispatch('setCenter', center) + if (center !== this.$store.state.Settings.center) { + this.$store.dispatch('setCenter', center) + } }, boundsUpdated (bounds) { - this.$store.dispatch('setBounds', bounds) + if (bounds !== this.$store.state.Settings.bounds) { + this.$store.dispatch('setBounds', bounds) + } } }, computed: {