fix: backup ordering in tree view

This commit is contained in:
Gareth George
2023-12-22 08:52:57 +00:00
parent d49b72996e
commit b9c8b3e378
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -297,12 +297,14 @@ const buildTreeLeaf = (operations: BackupInfo[]): OpTreeNode[] => {
}
return {
key: b.id!,
key: b.id,
backup: b,
icon: icon,
};
});
entries.sort(sortByKey);
entries.sort((a, b) => {
return b.backup!.startTimeMs - a.backup!.startTimeMs;
});
return entries;
};
+2 -2
View File
@@ -14,7 +14,6 @@ import { Config } from "../../gen/ts/v1/config.pb";
import { useAlertApi } from "../components/Alerts";
import { useShowModal } from "../components/ModalManager";
import { MainContentArea, useSetContent } from "./MainContentArea";
import { AddPlanModal } from "./AddPlanModal";
import { uiBuildVersion } from "../state/buildcfg";
import { ActivityBar } from "../components/ActivityBar";
@@ -121,7 +120,8 @@ const getSidenavItems = (config: Config | null): MenuProps["items"] => {
size="small"
shape="circle"
icon={<SettingOutlined />}
onClick={() => {
onClick={async () => {
const { AddPlanModal } = await import("./AddPlanModal");
showModal(<AddPlanModal template={plan} />);
}}
/>