You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Mobile: Plugin settings screen: Fix plugin states not set correctly when installing multiple plugins at once (#10580)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
@ -13,7 +13,7 @@ type GetRepoApiCallback = ()=> RepositoryApi;
|
||||
|
||||
const useOnInstallHandler = (
|
||||
setInstallingPluginIds: React.Dispatch<React.SetStateAction<Record<string, boolean>>>,
|
||||
pluginSettings: PluginSettings,
|
||||
pluginSettingsRef: React.RefObject<PluginSettings>,
|
||||
getRepoApi: GetRepoApiCallback|RepositoryApi,
|
||||
onPluginSettingsChange: OnPluginSettingChangeHandler,
|
||||
isUpdate: boolean,
|
||||
@ -45,6 +45,7 @@ const useOnInstallHandler = (
|
||||
}
|
||||
|
||||
if (!installError) {
|
||||
const pluginSettings = pluginSettingsRef.current;
|
||||
const newSettings = produce(pluginSettings, (draft: PluginSettings) => {
|
||||
draft[pluginId] = defaultPluginSetting();
|
||||
if (isUpdate) {
|
||||
@ -71,7 +72,7 @@ const useOnInstallHandler = (
|
||||
{ buttons: [_('OK')] },
|
||||
);
|
||||
}
|
||||
}, [getRepoApi, isUpdate, pluginSettings, onPluginSettingsChange, setInstallingPluginIds]);
|
||||
}, [getRepoApi, isUpdate, pluginSettingsRef, onPluginSettingsChange, setInstallingPluginIds]);
|
||||
};
|
||||
|
||||
export default useOnInstallHandler;
|
||||
|
Reference in New Issue
Block a user