mirror of https://github.com/buster-so/buster.git
Merge pull request #507 from buster-so/big-nate/bus-1371-icon-greyed-out
default version number is 1
This commit is contained in:
commit
b59d6fda57
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue