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