Merge pull request #507 from buster-so/big-nate/bus-1371-icon-greyed-out

default version number is 1
This commit is contained in:
Nate Kelley 2025-07-14 14:21:54 -06:00 committed by GitHub
commit b59d6fda57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ export const useGetDashboardAndInitializeMetrics = (prefetchData = true) => {
.queryKey,
data
);
onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 0);
onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 1);
}
return data;

View File

@ -110,7 +110,7 @@ export const useSaveDashboard = (params?: { updateOnSave?: boolean }) => {
data
);
setOriginalDashboard(data.dashboard);
onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 0);
onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 1);
}
}
});

View File

@ -56,7 +56,7 @@ export const useGetMetric = <TData = BusterMetric>(
if (isLatestVersion) {
setOriginalMetric(updatedMetric);
}
onSetLatestMetricVersion(id || '', last(updatedMetric.versions)?.version_number || 0);
onSetLatestMetricVersion(id || '', last(updatedMetric.versions)?.version_number || 1);
if (result?.version_number) {
queryClient.setQueryData(
metricsQueryKeys.metricsGetMetric(result.id, result.version_number).queryKey,