mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
refactor: journals
This commit is contained in:
@@ -57,7 +57,7 @@ export const useApiStore = defineStore('apiStore', {
|
||||
|
||||
// Active data schedueler
|
||||
this.fetchActiveData();
|
||||
this.setupActiveDataFetcher();
|
||||
// this.setupActiveDataFetcher();
|
||||
},
|
||||
|
||||
async setupActiveDataFetcher() {
|
||||
@@ -72,13 +72,14 @@ export const useApiStore = defineStore('apiStore', {
|
||||
if (!this.activeData) this.dataStatuses.connection = Status.Data.Loading;
|
||||
|
||||
try {
|
||||
console.log('Fetching active data at ' + new Date().toLocaleTimeString('pl-PL'));
|
||||
|
||||
const response = await this.client!.get<API.ActiveData.Response>('api/getActiveData');
|
||||
console.log(response);
|
||||
|
||||
this.activeData = response.data;
|
||||
this.lastFetchData = new Date();
|
||||
this.dataStatuses.connection = Status.Data.Loaded;
|
||||
|
||||
console.log('Fetching active data at ' + new Date().toLocaleTimeString('pl-PL'));
|
||||
} catch (error) {
|
||||
this.dataStatuses.connection = Status.Data.Error;
|
||||
console.error('Ups! Wystąpił błąd podczas pobierania danych online:', error);
|
||||
|
||||
Reference in New Issue
Block a user