feat: add success notification for dashboard layout save (#7510)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/7516/head^2
Ryan Wang 2025-06-10 00:08:38 +08:00 committed by GitHub
parent 9a52de0f4e
commit c604952914
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -257,6 +257,8 @@ async function handleSave() {
await queryClient.invalidateQueries({
queryKey: ["core:dashboard:widgets:view"],
});
Toast.success(t("core.common.toast.save_success"));
} catch (error) {
console.error("Failed to save dashboard widgets config", error);
} finally {

View File

@ -4,6 +4,7 @@ import type {
DashboardWidget,
} from "@halo-dev/console-shared";
import { useQuery } from "@tanstack/vue-query";
import { cloneDeep } from "lodash-es";
import { computed, ref, type Ref } from "vue";
import { DefaultResponsiveLayouts } from "../widgets/defaults";
@ -31,7 +32,7 @@ export function useDashboardWidgetsFetch(breakpoint: Ref<string>) {
layouts.value[breakpoint.value] || layouts.value["lg"] || [];
layout.value = layoutData;
originalLayout.value = layoutData;
originalLayout.value = cloneDeep(layoutData);
},
enabled: computed(() => !!breakpoint.value),
});