diff --git a/package.json b/package.json
index 36c818c..92f66be 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stacjownik",
- "version": "1.20.4",
+ "version": "1.20.5",
"private": true,
"scripts": {
"dev": "vite",
diff --git a/src/App.vue b/src/App.vue
index 66df5ae..b71478b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -47,8 +47,6 @@ import TrainModal from './components/TrainsView/TrainModal.vue';
import StorageManager from './managers/storageManager';
import { useApiStore } from './store/apiStore';
import { Status } from './typings/common';
-import { Websocket } from './typings/api';
-import socket from './websocket';
export default defineComponent({
components: {
@@ -88,39 +86,7 @@ export default defineComponent({
this.setReleaseURL();
this.setupOfflineHandling();
- this.apiStore.setupStaticAPIData();
- this.connectToWebsocket();
- },
-
- async connectToWebsocket() {
- this.apiStore.dataStatuses.connection = Status.Data.Loading;
-
- console.log('ws connecting');
-
- socket.on('connect_error', (err) => {
- console.error(`WS connection error: ${err.message}`);
-
- this.apiStore.dataStatuses.connection = Status.Data.Error;
- this.apiStore.websocketData = undefined;
- });
-
- let timeFrom = Date.now();
- socket.on('connect', () => {
- socket.emit('CONNECTION', { version: packageInfo.version }, () => {
- console.log(`Connection time: ${Date.now() - timeFrom}ms`);
- });
-
- console.log('ws connected');
- });
-
- socket.on('UPDATE', (data: Websocket.Payload) => {
- console.log('ws update');
-
- this.apiStore.websocketData = data;
- this.apiStore.dataStatuses.connection = Status.Data.Loaded;
- });
-
- this.fetchWebsocketData();
+ this.apiStore.setupAPIData();
},
setupOfflineHandling() {
@@ -135,24 +101,14 @@ export default defineComponent({
handleOfflineMode() {
this.store.isOffline = true;
- this.apiStore.websocketData = undefined;
+ this.apiStore.activeData = undefined;
this.apiStore.dataStatuses.connection = Status.Data.Offline;
},
handleOnlineMode() {
this.store.isOffline = false;
- this.apiStore.setupStaticAPIData();
- this.connectToWebsocket();
- },
-
- fetchWebsocketData() {
- socket.emit('FETCH_DATA', (data: Websocket.Payload) => {
- console.log('ws fetch data');
-
- this.apiStore.websocketData = data;
- this.apiStore.dataStatuses.connection = Status.Data.Loaded;
- });
+ this.apiStore.setupAPIData();
},
changeLang(lang: string) {
diff --git a/src/components/App/StatusIndicator.vue b/src/components/App/StatusIndicator.vue
index aa07cc9..16d0bd3 100644
--- a/src/components/App/StatusIndicator.vue
+++ b/src/components/App/StatusIndicator.vue
@@ -36,11 +36,11 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -194,125 +198,112 @@