perf: ignore CancelledError in all queries, and show error message in route pages
This commit is contained in:
@@ -4,7 +4,7 @@ import { STATION_LIST_QUERY_KEY } from '@/constants';
|
||||
import { useQueryControlStore } from '@/stores/query-control';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
import { useMutation, useQuery } from '@tanstack/vue-query';
|
||||
import { isCancelledError, useMutation, useQuery } from '@tanstack/vue-query';
|
||||
import axios from 'axios';
|
||||
import dayjs from 'dayjs';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -60,5 +60,10 @@ function useStationListMutation() {
|
||||
stationList.value.splice(0, stationList.value.length, ...stations);
|
||||
}
|
||||
},
|
||||
onError: (error) => {
|
||||
if (!isCancelledError(error)) {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user