Skip to content

Commit

Permalink
refactor: dead code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Apr 1, 2024
1 parent e872a32 commit 818b0f3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 71 deletions.
4 changes: 0 additions & 4 deletions src/components/Authenticated/CurrentFlights.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ onMounted(() => {
sort_local();
});
// onMounted(() => {
// local
// })
const init = computed((): boolean => {
return aircraftStore.init;
});
Expand Down
66 changes: 0 additions & 66 deletions src/store/aircraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,6 @@ export const aircraftModule = defineStore(ModuleName.AIRCRAFT, {
current_flights: (state): Array<TAdsbdb> => {
return state._current_flights;
},
// if (!state.sort_by) {
// return state._current_flights.sort((a, b) => {
// const callsign_a = a.callsign || 'z';
// const callsign_b = b.callsign || 'z';
// return callsign_a === callsign_b ? a.altitude > b.altitude ? 1 : 0 : callsign_a > callsign_b ? 1 : 0;
// });
// } else {
// if (state.sort_by === 'altitude') {
// return state._current_flights.sort((a, b) => {
// if (state.sort_asc) {
// return a.altitude >= b.altitude ? 1 : -1;
// } else {
// return a.altitude >= b.altitude ? -1 : 1;
// }
// });
// } else if (state.sort_by === 'aircraft') {

// return state._current_flights.sort((a, b) => {
// const aircraft_a =`${a.aircraft.manufacturer} ${a.aircraft.icao_type}`;
// const aircraft_b =`${b.aircraft.manufacturer} ${b.aircraft.icao_type}`;
// if (state.sort_asc) {
// return aircraft_a.toLowerCase() >= aircraft_b.toLowerCase()? 1 : -1;
// } else {
// return aircraft_a.toLowerCase() >=aircraft_b.toLowerCase() ? -1 : 1;
// }
// });
// } else if (state.sort_by === 'owner') {
// return state._current_flights.sort((a, b) => {
// if (state.sort_asc) {
// return a.aircraft.registered_owner.toLowerCase() >= b.aircraft.registered_owner.toLowerCase() ? 1 : -1;
// } else {
// return a.aircraft.registered_owner.toLowerCase() >= b.aircraft.registered_owner.toLowerCase() ? -1 : 1;
// }
// });
// } else {
// return state._current_flights.sort((a, b) => {
// const callsign_a = a.callsign || 'z';
// const callsign_b = b.callsign || 'z';
// if (state.sort_asc) {
// return callsign_a >= callsign_b ? 1 : -1;
// } else {
// return callsign_a >= callsign_b ? -1 : 1;
// }
// });
// }
// }
// },

number_current_flights (): number {
return this.current_flights.length;
Expand All @@ -86,25 +39,6 @@ export const aircraftModule = defineStore(ModuleName.AIRCRAFT, {
},

set_sort_by (s: u<TSortBy>) {
// if (!s) {
// this._current_flights.sort((a, b) => {
// const callsign_a = a.callsign || 'z';
// const callsign_b = b.callsign || 'z';
// return callsign_a === callsign_b ? a.altitude > b.altitude ? 1 : 0 : callsign_a > callsign_b ? 1 : 0;
// });
// } else {
// if (s === 'altitude') {
// const copy = [ ... this._current_flights ];
// copy.sort((a, b) => {
// if (this.sort_asc) {
// return a.altitude >= b.altitude ? 1 : -1;
// } else {
// return a.altitude >= b.altitude ? -1 : 1;
// }
// });
// this._current_flights = copy;
// }
// }
this.sort_by = s;
},

Expand Down
Loading

0 comments on commit 818b0f3

Please sign in to comment.