fix some empty actions

This commit is contained in:
vcoppe
2024-09-10 17:42:36 +02:00
parent a1383a7e97
commit 10e328f2a3

View File

@@ -513,7 +513,7 @@ export const dbUtils = {
});
},
reverseSelection: () => {
if (!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints'])) {
if (!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints']) || get(gpxStatistics).local.points?.length <= 1) {
return;
}
applyGlobal((draft) => {
@@ -1053,6 +1053,10 @@ export const dbUtils = {
}
});
if (points.length === 0) {
return;
}
getElevation(points).then((elevations) => {
applyGlobal((draft) => {
applyToOrderedSelectedItemsFromFile((fileId, level, items) => {