From 4b1c6532350f434fa24fea1598b46ebab0edcb93 Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Sun, 24 Mar 2024 15:18:46 +0300 Subject: [PATCH] some fixes --- src/App.vue | 15 ++++++++++----- src/models/map.ts | 8 +++++++- src/utils/store.ts | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4225347..ee5e343 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,6 +39,8 @@ onMounted(() => { {'name': 'Конец', 'up': true, 'connectedStations': [], 'step': store.width - 400} ] + window.onbeforeunload = () => false + map = new Map(branch, settings); build(); @@ -117,7 +119,7 @@ function build () { connectedStations.push(extraStation); } - let modelStation = new Station(station['name'], station['up'], connectedStations, station['step']) + let modelStation = new Station(station['name'], station['up'], connectedStations, Number(station['step'])) stations.push(modelStation); } @@ -130,6 +132,10 @@ function build () { map.build() } + +store.$subscribe((mutation, state) => { + build(); +})