[UI > PluginCard] Fix crash with icon

This commit is contained in:
Beef 2023-01-16 08:11:46 +00:00
parent 66e84ecd8d
commit af936940a0
2 changed files with 3 additions and 3 deletions

4
src/def.d.ts vendored
View file

@ -46,8 +46,8 @@ interface PluginManifest {
main: string;
hash: string;
// Vendor-specific field, contains our own data
vendetta: {
icon: string;
vendetta?: {
icon?: string;
};
}

View file

@ -52,7 +52,7 @@ export default function PluginCard({ plugin }: PluginCardProps) {
<FormRow
style={styles.header}
label={`${plugin.manifest.name} by ${plugin.manifest.authors.map(i => i.name).join(", ")}`}
leading={<FormRow.Icon source={getAssetIDByName(plugin.manifest.vendetta.icon || "ic_application_command_24px")} />}
leading={<FormRow.Icon source={getAssetIDByName(plugin.manifest.vendetta?.icon || "ic_application_command_24px")} />}
trailing={
<FormSwitch
value={plugin.enabled}