[Refactor/bugfix/TMP] TMP:

Separate plugins controller.
Add ui pattern for outdated plugins and the plugin that is not supported current vrct version but supported in newest vrct version.
This commit is contained in:
Sakamoto Shiina
2025-04-15 16:48:50 +09:00
parent ddc6408828
commit 379ca86b45
10 changed files with 251 additions and 150 deletions

View File

@@ -0,0 +1,36 @@
import React, { useEffect } from "react";
import { usePlugins } from "@logics_configs";
import clsx from "clsx";
if (typeof window !== "undefined") {
window.React = React;
window.clsx = clsx;
}
export const LoadPluginsController = () => {
const {
asyncLoadAllPlugins,
currentIsInitializedLoadPlugin,
updateIsInitializedLoadPlugin,
} = usePlugins();
const asyncInitLoadPlugins = async () => {
try {
await asyncLoadAllPlugins();
} catch (error) {
console.error(error);
}
};
useEffect(() => {
if (!currentIsInitializedLoadPlugin.data) {
asyncInitLoadPlugins().then(() => {
updateIsInitializedLoadPlugin(true);
});
}
}, []);
return null;
};