Skip to content

Commit

Permalink
Call refreshModelRunDownloadingStatuses directly
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Sep 12, 2024
1 parent 23c69fb commit 962407c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
4 changes: 1 addition & 3 deletions vue/src/components/ModelRunList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ModelRunCard from "./ModelRunCard.vue";
import type { ModelRunList } from "../client/models/ModelRunList";
import type { QueryArguments } from "../client";
import { computed, onMounted, ref, watch, withDefaults } from "vue";
import { filteredSatelliteTimeList, queryModelRuns, refreshModelRunDownloadingStatuses, state, updateCameraBoundsBasedOnModelRunList } from "../store";
import { filteredSatelliteTimeList, queryModelRuns, state, updateCameraBoundsBasedOnModelRunList } from "../store";
import type { KeyedModelRun } from '../store'
import { hoveredInfo } from "../interactions/mouseEvents";
Expand All @@ -28,8 +28,6 @@ async function loadModelRuns(type: 'firstPage' | 'nextPage') {
emit('modelrunlist', modelRunList);
}
watch(() => state.downloadingCheck, () => refreshModelRunDownloadingStatuses());
const loadingSatelliteTimestamps = ref(false);
function handleToggle(modelRun: KeyedModelRun) {
Expand Down
7 changes: 3 additions & 4 deletions vue/src/components/annotationViewer/AnnotationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
DownloadSettings,
SiteList,
} from "../../client/services/ApiService";
import { state, updateCameraBoundsBasedOnModelRunList } from "../../store";
import { refreshModelRunDownloadingStatuses, state, updateCameraBoundsBasedOnModelRunList } from "../../store";
import { clickedInfo, hoveredInfo } from "../../interactions/mouseEvents";
import ImagesDownloadDialog from "../ImagesDownloadDialog.vue";
import SiteListCard from "../siteList/SiteListCard.vue";
Expand Down Expand Up @@ -128,7 +128,6 @@ const getSiteProposals = async () => {
if (selected) {
selectSite(selected);
}
}
}
};
Expand Down Expand Up @@ -238,8 +237,8 @@ const startDownload = async (data: DownloadSettings) => {
const id = imageDownloadingId.value;
imageDownloadDialog.value = false;
if (id) {
await ApiService.getObservationImages(id, data);
state.downloadingCheck += 1;
await ApiService.getObservationImages(id, data);
refreshModelRunDownloadingStatuses();
// Now we get the results to see if the service is running
setTimeout(() => getSiteProposals(), 1000);
}
Expand Down
14 changes: 7 additions & 7 deletions vue/src/components/siteList/SiteList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SiteListCard from "./SiteListCard.vue";
import { SiteDisplay } from "./SiteListCard.vue";
import SiteListHeader from "./SiteListHeader.vue";
import SiteListFilter from "./SiteListFilter.vue";
import { getSiteObservationDetails, state } from "../../store";
import { getSiteObservationDetails, refreshModelRunDownloadingStatuses, state } from "../../store";
import { scoringColors, scoringColorsKeys } from "../../mapstyle/annotationStyles";
const props = defineProps<{
Expand Down Expand Up @@ -283,12 +283,12 @@ const startDownload = async (data: DownloadSettings) => {
const id = imageDownloadingId.value;
imageDownloadDialog.value = false;
if (id) {
await ApiService.getObservationImages(id, data);
// Notify the ModelRunList that downloading is happening
if (imageDownloadingModelRunId.value) {
emit('image-download', imageDownloadingModelRunId.value);
}
state.downloadingCheck += 1;
await ApiService.getObservationImages(id, data);
// Notify the ModelRunList that downloading is happening
if (imageDownloadingModelRunId.value) {
emit('image-download', imageDownloadingModelRunId.value);
}
refreshModelRunDownloadingStatuses();
// Now we get the results to see if the service is running
setTimeout(() => getAllSiteProposals(), 1000);
}
Expand Down
3 changes: 0 additions & 3 deletions vue/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ export const state = reactive<{
// Region map is used to index names and owners with ids
regionMap: RegionMapType;
regionList: RegionDetail[];
// Downloading Check - used to indicate to the modelRunList to check for downloading images
downloadingCheck: number;
// Query states - stores states for network queries
queryStates: {
loadModelRuns: {
Expand Down Expand Up @@ -292,7 +290,6 @@ export const state = reactive<{
groundTruthLinks: {},
regionMap: {},
regionList: [],
downloadingCheck: 0,
queryStates: {
loadModelRuns: {
inflightQueries: 0,
Expand Down

0 comments on commit 962407c

Please sign in to comment.