[Update] Plugins: Add error handlings when network is not connected and failed to fetch plugins info.

Also add pending ui(TMP) while fetching.
This commit is contained in:
Sakamoto Shiina
2025-04-25 18:51:16 +09:00
parent 81a422b07d
commit 249c686442
5 changed files with 23 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ export const usePlugins = () => {
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
const { asyncStdoutToPython } = useStdoutToPython();
const { currentFetchedPluginsInfo, updateFetchedPluginsInfo, pendingFetchedPluginsInfo } = useStore_FetchedPluginsInfo();
const { currentFetchedPluginsInfo, updateFetchedPluginsInfo, pendingFetchedPluginsInfo, errorFetchedPluginsInfo } = useStore_FetchedPluginsInfo();
const { currentLoadedPlugins, updateLoadedPlugins, pendingLoadedPlugins } = useStore_LoadedPlugins();
const { currentSavedPluginsStatus, updateSavedPluginsStatus, pendingSavedPluginsStatus } = useStore_SavedPluginsStatus();
@@ -252,6 +252,7 @@ export const usePlugins = () => {
updateFetchedPluginsInfo(updated_list);
} catch (error) {
console.error("Error fetching plugin info list: ", error);
errorFetchedPluginsInfo();
}
store.is_initialized_fetched_plugin_info = true;

View File

@@ -206,7 +206,12 @@ export const useReceiveRoutes = () => {
"/set/data/main_window_geometry": () => {},
"/run/open_filepath_logs": () => console.log("Opened Directory, Message Logs"),
"/run/open_filepath_config_file": () => console.log("Opened Directory, Config File"),
"/run/software_update_info": updateLatestSoftwareVersionInfo,
"/run/software_update_info": (payload) => {
updateLatestSoftwareVersionInfo(prev => ({
is_update_available: payload.is_update_available,
new_version: payload.new_version || prev.data.new_version,
}));
},
"/run/connected_network": handleNetworkConnection,
// Main Page