diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-16 10:45:13 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-16 10:45:13 +1100 |
| commit | 3b20b6ce0038ddb25e06ecc5103d77e19e23e1c1 (patch) | |
| tree | b0d5ad861935ed4409255145e49837ed37af5914 /src/components/SearchModal.vue | |
| parent | a911be98d2137be5ea7f17d1df73a2215dfb7c75 (diff) | |
Add loading indicator
Diffstat (limited to 'src/components/SearchModal.vue')
| -rw-r--r-- | src/components/SearchModal.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index ade86be..be8df51 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -47,7 +47,7 @@ const props = defineProps({ eventTree: {type: Object as PropType<RBTree<HistEvent>>, required: true}, titleToEvent: {type: Object as PropType<Map<string, HistEvent>>, required: true}, }); -const emit = defineEmits(['search', 'close', 'info-click']); +const emit = defineEmits(['search', 'close', 'info-click', 'net-wait', 'net-get']); // Search-suggestion data const searchSuggs = ref([] as string[]); @@ -179,7 +179,9 @@ async function resolveSearch(eventTitle: string){ if (store.reqImgs){ urlParams.append('imgonly', 'true'); } + emit('net-wait'); // Allows the parent component to show a loading-indicator let responseObj: EventInfoJson | null = await queryServer(urlParams); + emit('net-get'); if (responseObj != null){ let eventInfo = jsonToEventInfo(responseObj); if (store.reqImgs && eventInfo.event.imgId == null){ |
