perf: add success toast for saving plugin and theme settings

pull/895/head
Ryan Wang 2023-02-28 17:04:45 +08:00
parent de2612da27
commit 199a6a5a9a
3 changed files with 9 additions and 2 deletions

View File

@ -3,7 +3,7 @@
import { inject, ref, watch } from "vue";
// components
import { VButton } from "@halo-dev/components";
import { Toast, VButton } from "@halo-dev/components";
// types
import type { Ref } from "vue";
@ -63,6 +63,8 @@ const handleSaveConfigMap = async () => {
configMap: configMapToUpdate,
});
Toast.success("保存成功");
await handleFetchSettings();
configMap.value = newConfigMap;

View File

@ -21,6 +21,7 @@ import {
IconPhone,
IconTablet,
IconRefreshLine,
Toast,
} from "@halo-dev/components";
import { storeToRefs } from "pinia";
import { computed, markRaw, ref, watch } from "vue";
@ -163,6 +164,8 @@ const handleSaveConfigMap = async () => {
configMap: configMapToUpdate,
});
Toast.success("保存成功");
await handleFetchSettings();
configMap.value = newConfigMap;

View File

@ -7,7 +7,7 @@ import { useSettingFormConvert } from "@/composables/use-setting-form";
import { apiClient } from "@/utils/api-client";
// components
import { VButton } from "@halo-dev/components";
import { Toast, VButton } from "@halo-dev/components";
// types
import type { ConfigMap, Plugin, Setting } from "@halo-dev/api-client";
@ -55,6 +55,8 @@ const handleSaveConfigMap = async () => {
configMap: configMapToUpdate,
});
Toast.success("保存成功");
await handleFetchSettings();
configMap.value = newConfigMap;
saving.value = false;