[Refactor] Remove the code that is no longer in use.
This commit is contained in:
@@ -4,7 +4,6 @@ import { usePlugins } from "@logics_configs";
|
||||
export const LoadPluginsController = ({ pluginsControllerHasRunRef }) => {
|
||||
const {
|
||||
asyncLoadAllPlugins,
|
||||
updateIsInitializedLoadPlugin,
|
||||
} = usePlugins();
|
||||
|
||||
const asyncInitLoadPlugins = async () => {
|
||||
@@ -17,9 +16,7 @@ export const LoadPluginsController = ({ pluginsControllerHasRunRef }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!pluginsControllerHasRunRef.current.is_initialized_load_plugin) {
|
||||
asyncInitLoadPlugins().then(() => {
|
||||
updateIsInitializedLoadPlugin(true);
|
||||
});
|
||||
asyncInitLoadPlugins();
|
||||
pluginsControllerHasRunRef.current.is_initialized_load_plugin = true;
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -10,7 +10,7 @@ export const MergePluginsController = () => {
|
||||
currentFetchedPluginsInfo,
|
||||
currentSavedPluginsStatus,
|
||||
downloadAndExtractPlugin,
|
||||
toggleSavedPluginStatus,
|
||||
toggleSavedPluginsStatus,
|
||||
} = usePlugins();
|
||||
const { checkVrctVerCompatibility } = useSoftwareVersion();
|
||||
|
||||
@@ -131,7 +131,7 @@ export const MergePluginsController = () => {
|
||||
!plugin.latest_plugin_info?.is_plugin_supported
|
||||
) {
|
||||
plugin.is_enabled = false;
|
||||
toggleSavedPluginStatus(plugin.plugin_id);
|
||||
toggleSavedPluginsStatus(plugin.plugin_id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,11 +5,8 @@ import { PluginsControlComponent } from "../_components/plugins_control_componen
|
||||
|
||||
export const Plugins = () => {
|
||||
const {
|
||||
currentIsPluginsInitialized,
|
||||
} = usePlugins();
|
||||
|
||||
// if (!currentIsPluginsInitialized.data) return null;
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<PluginDownloadContainer />
|
||||
@@ -22,7 +19,7 @@ const PluginDownloadContainer = () => {
|
||||
downloadAndExtractPlugin,
|
||||
currentPluginsData,
|
||||
currentSavedPluginsStatus,
|
||||
toggleSavedPluginStatus,
|
||||
toggleSavedPluginsStatus,
|
||||
handlePendingPlugin,
|
||||
} = usePlugins();
|
||||
|
||||
@@ -40,7 +37,7 @@ const PluginDownloadContainer = () => {
|
||||
|
||||
// プラグインのオンオフ切り替え処理
|
||||
const toggleFunction = (target_plugin_id) => {
|
||||
toggleSavedPluginStatus(target_plugin_id);
|
||||
toggleSavedPluginsStatus(target_plugin_id);
|
||||
};
|
||||
|
||||
const variable_state = currentSavedPluginsStatus.state;
|
||||
|
||||
@@ -4,8 +4,6 @@ import {
|
||||
createAtomWithHook,
|
||||
useStore_SavedPluginsStatus,
|
||||
useStore_PluginsData,
|
||||
useStore_IsPluginsInitialized,
|
||||
useStore_IsInitializedLoadPlugin,
|
||||
useStore_IsFetchedPluginsInfo,
|
||||
|
||||
useStore_FetchedPluginsInfo,
|
||||
@@ -39,7 +37,6 @@ const PLUGIN_LIST_URL = getPluginsList();
|
||||
export const usePlugins = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
const { currentIsInitializedLoadPlugin, updateIsInitializedLoadPlugin, pendingIsInitializedLoadPlugin } = useStore_IsInitializedLoadPlugin();
|
||||
const { currentIsFetchedPluginsInfo, updateIsFetchedPluginsInfo, pendingIsFetchedPluginsInfo } = useStore_IsFetchedPluginsInfo();
|
||||
|
||||
const { currentFetchedPluginsInfo, updateFetchedPluginsInfo, pendingFetchedPluginsInfo } = useStore_FetchedPluginsInfo();
|
||||
@@ -47,7 +44,6 @@ export const usePlugins = () => {
|
||||
|
||||
const { currentSavedPluginsStatus, updateSavedPluginsStatus, pendingSavedPluginsStatus } = useStore_SavedPluginsStatus();
|
||||
const { currentPluginsData, updatePluginsData, pendingPluginsData } = useStore_PluginsData();
|
||||
const { currentIsPluginsInitialized, updateIsPluginsInitialized, pendingIsPluginsInitialized } = useStore_IsPluginsInitialized();
|
||||
const { checkVrctVerCompatibility } = useSoftwareVersion();
|
||||
|
||||
const { asyncTauriFetchGithub } = useFetch();
|
||||
@@ -301,7 +297,7 @@ export const usePlugins = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const toggleSavedPluginStatus = (target_plugin_id) => {
|
||||
const toggleSavedPluginsStatus = (target_plugin_id) => {
|
||||
const is_exists = currentSavedPluginsStatus.data.some(
|
||||
(d) => d.plugin_id === target_plugin_id
|
||||
);
|
||||
@@ -361,11 +357,6 @@ export const usePlugins = () => {
|
||||
currentPluginsData,
|
||||
updatePluginsData,
|
||||
|
||||
currentIsPluginsInitialized,
|
||||
updateIsPluginsInitialized,
|
||||
|
||||
currentIsInitializedLoadPlugin,
|
||||
updateIsInitializedLoadPlugin,
|
||||
currentIsFetchedPluginsInfo,
|
||||
updateIsFetchedPluginsInfo,
|
||||
|
||||
@@ -375,7 +366,7 @@ export const usePlugins = () => {
|
||||
currentLoadedPlugins,
|
||||
updateLoadedPlugins,
|
||||
|
||||
toggleSavedPluginStatus,
|
||||
toggleSavedPluginsStatus,
|
||||
setSavedPluginsStatus,
|
||||
|
||||
handlePendingPlugin,
|
||||
|
||||
@@ -278,8 +278,6 @@ export const { atomInstance: Atom_Hotkeys, useHook: useStore_Hotkeys } = createA
|
||||
}, "Hotkeys");
|
||||
|
||||
// Plugins
|
||||
export const { atomInstance: Atom_IsPluginsInitialized, useHook: useStore_IsPluginsInitialized } = createAtomWithHook(false, "IsPluginsInitialized");
|
||||
export const { atomInstance: Atom_IsInitializedLoadPlugin, useHook: useStore_IsInitializedLoadPlugin } = createAtomWithHook(false, "IsInitializedLoadPlugin");
|
||||
export const { atomInstance: Atom_IsFetchedPluginsInfo, useHook: useStore_IsFetchedPluginsInfo } = createAtomWithHook(false, "IsFetchedPluginsInfo");
|
||||
|
||||
export const { atomInstance: Atom_FetchedPluginsInfo, useHook: useStore_FetchedPluginsInfo } = createAtomWithHook([], "FetchedPluginsInfo");
|
||||
|
||||
Reference in New Issue
Block a user