fix(plugins/settings.plugins): small errors & inconsistencies
- Soft errors now nudge UI to rerender. - `runPluginLate` will throw anyway, so early return is cleaner. - `confirmInstall` returns a `Promise` which the AlertModal should await before closing.
This commit is contained in:
parent
ff263a2282
commit
5432276ab0
3 changed files with 8 additions and 10 deletions
|
|
@ -289,9 +289,10 @@ registerJSMethod(
|
|||
if (!plugin) return
|
||||
|
||||
const meta = getInternalPluginMeta(plugin)
|
||||
if (meta) {
|
||||
meta.nativeErrors = Object.freeze(errors)
|
||||
}
|
||||
// TODO: Do we need an errored event specifically?
|
||||
// Nudge open UI to re-render the errors row
|
||||
pEmitter.emit('flagUpdate', plugin)
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,16 +31,12 @@ export default function PluginInstallConfirmAlert({
|
|||
<AlertActionButton
|
||||
text="Install"
|
||||
variant="primary"
|
||||
onPress={() => {
|
||||
confirmInstall(prompt.token, true)
|
||||
}}
|
||||
onPress={() => confirmInstall(prompt.token, true)}
|
||||
/>
|
||||
<AlertActionButton
|
||||
text="Cancel"
|
||||
variant="secondary"
|
||||
onPress={() => {
|
||||
confirmInstall(prompt.token, false)
|
||||
}}
|
||||
onPress={() => confirmInstall(prompt.token, false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,8 +64,9 @@ export async function handleEnablePlugin(plugin: AnyPlugin) {
|
|||
try {
|
||||
await enablePlugin(plugin)
|
||||
} catch (e) {
|
||||
// Requirements not satisfied by native
|
||||
// Requirements not satisfied by native, don't try to start
|
||||
showErrorToast(messageOf(e))
|
||||
return
|
||||
}
|
||||
|
||||
await runPluginLate(plugin).catch(noop)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue