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:
PalmDevs 2026-07-26 01:03:23 +07:00
parent ff263a2282
commit 5432276ab0
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
3 changed files with 8 additions and 10 deletions

View file

@ -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)
},
)

View file

@ -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)}
/>
</>
}

View file

@ -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)