mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Update plugin validation state on plugin state change
This commit is contained in:
@@ -30,11 +30,10 @@ export function PluginManagementCard({plugin}: { plugin: PluginDto }) {
|
|||||||
const [configValidationResult, setConfigValidationResult] = useState<PluginConfigValidationResult | undefined>(undefined);
|
const [configValidationResult, setConfigValidationResult] = useState<PluginConfigValidationResult | undefined>(undefined);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
PluginEndpoint.validatePluginConfig(plugin.id).then((response: PluginConfigValidationResult | undefined) => {
|
PluginEndpoint.validatePluginConfig(plugin.id).then((response: PluginConfigValidationResult) => {
|
||||||
if (response === undefined) return;
|
|
||||||
setConfigValidationResult(response);
|
setConfigValidationResult(response);
|
||||||
});
|
});
|
||||||
}, [pluginDetailsModal.isOpen]);
|
}, [pluginDetailsModal.isOpen, plugin.state]);
|
||||||
|
|
||||||
function borderColor(state: PluginState | undefined, trustLevel: PluginTrustLevel | undefined): "success" | "warning" | "danger" | "default" {
|
function borderColor(state: PluginState | undefined, trustLevel: PluginTrustLevel | undefined): "success" | "warning" | "danger" | "default" {
|
||||||
if (trustLevel === PluginTrustLevel.UNTRUSTED) return "danger";
|
if (trustLevel === PluginTrustLevel.UNTRUSTED) return "danger";
|
||||||
|
|||||||
Reference in New Issue
Block a user