Skip to content

Commit

Permalink
feat: snack on no message received
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Jun 17, 2024
1 parent 94c498c commit c0ac8c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/components/Authenticated/CurrentFlights.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,13 @@ const sort_local = (): void => {
};
watch(sort_asc, (_) => {
// handle the sort in here
sort_local();
});
watch(sort_by, (_) => {
// handle the sort in here
sort_local();
});
watch(current_flights, (i) => {
// handle the sort in here
local_current_flights.value = [ ...i ];
sort_local();
});
Expand Down
7 changes: 5 additions & 2 deletions src/store/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { dialogModule } from './dialog';
import { flightboxStatusModule } from './flightboxStatus';
import { loadingModule } from './loading';
import { ModuleName } from '@/types/enum_module';
import { snackError } from '@/services/snack';
import { snackError, snackReset } from '@/services/snack';
import { websocketModule } from './websocket';
// import { useRoute, useRouter } from 'vue-router';
import { getActivePinia } from 'pinia';
Expand All @@ -24,7 +24,10 @@ export const userModule = defineStore(ModuleName.USER, {
aircraftModule().$reset();
websocketModule().closeWS();
dialogModule().$reset();
if (message) snackError({ message });
if (message) {
snackReset();
snackError({ message });
}
getActivePinia()?.router().push(FrontendRoutes.LOGIN);
},

Expand Down
3 changes: 2 additions & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ const initCheck = (): void => {
loading.value = false;
}
else if (initCount.value < 4) {
snackError({ message: 'No message received, retrying' });
send_status_and_flights();
initCheck();
}
else userStore.logout('unable to contact flightbox');
}, 10000);
}, 8500);
};
const refresh = () :void => {
Expand Down

0 comments on commit c0ac8c8

Please sign in to comment.