mirror of https://github.com/halo-dev/halo
feat: add success notification for dashboard layout save (#7510)
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/7516/head^2
parent
9a52de0f4e
commit
c604952914
|
@ -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 {
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue