Browse Source

[release-2.0] fix: plugin failed to get settings when plugin is stopped (#755)

This is an automated cherry-pick of #750

/assign ruibaby

```release-note
修复在 Console 端停止插件时,仍然获取设置选项导致显示失败提示的问题。
```
pull/754/head^2
Halo Dev Bot 2 years ago committed by GitHub
parent
commit
0756d72106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/modules/system/plugins/layouts/PluginLayout.vue

5
src/modules/system/plugins/layouts/PluginLayout.vue

@ -25,6 +25,7 @@ import BasicLayout from "@/layouts/BasicLayout.vue";
import type { Ref } from "vue";
import type { Plugin, SettingForm } from "@halo-dev/api-client";
import { usePermission } from "@/utils/permission";
import { usePluginLifeCycle } from "../composables/use-plugin";
const { currentUserHasPermission } = usePermission();
@ -60,6 +61,8 @@ provide<Ref<string | undefined>>("activeTab", activeTab);
const settingName = computed(() => plugin.value?.spec.settingName);
const configMapName = computed(() => plugin.value?.spec.configMapName);
const { isStarted } = usePluginLifeCycle(plugin);
const { setting, handleFetchSettings } = useSettingForm(
settingName,
configMapName
@ -112,7 +115,9 @@ onMounted(async () => {
return;
}
if (isStarted.value) {
await handleFetchSettings();
}
tabs.value = cloneDeep(initialTabs);

Loading…
Cancel
Save