sonar 1 left

This commit is contained in:
Cindy Chang
2024-08-09 14:54:22 +08:00
parent 995b09cc02
commit 6c38ada281

View File

@@ -42,6 +42,7 @@
import { storeToRefs } from 'pinia';
import LoadingStore from '@/stores/loading.js';
import AllMapDataStore from '@/stores/allMapData.js';
import { delaySecond, } from '@/utils/timeUtil.js';
export default {
setup() {
@@ -97,8 +98,9 @@ export default {
if(!this.postRuleData?.length) return this.$toast.error('Not selected');
await this.allMapDataStore.checkHasResult(); // 後端快速檢查有沒有結果
if(this.hasResultRule === null) return;
else if(this.hasResultRule) {
if(this.hasResultRule === null) {
return;
} else if(this.hasResultRule) {
this.isLoading = true;
await this.allMapDataStore.addTempFilterId();
await this.allMapDataStore.getAllMapData();
@@ -109,12 +111,14 @@ export default {
await this.$emit('submit-all');
this.isLoading = false;
this.$toast.success('Filter(s) applied.');
}else {
this.isLoading = true;
await new Promise(resolve => setTimeout(resolve, 1000));
this.isLoading = false;
this.$toast.warning('No result.');
};
return;
}
// sonar-qube "This statement will not be executed conditionally"
this.isLoading = true;
await delaySecond(1);
this.isLoading = false;
this.$toast.warning('No result.');
},
}
}