Fix Logo parsing in React Native to support string/base64 matching (#1622)

This commit is contained in:
Leendert de Borst
2026-02-05 10:12:47 +01:00
committed by Leendert de Borst
parent 41aa5e9610
commit 67dfc2f495

View File

@@ -1,3 +1,5 @@
import { Buffer } from 'buffer';
import { BaseRepository } from '../BaseRepository';
/**
@@ -141,6 +143,11 @@ export class LogoRepository extends BaseRepository {
}
try {
// Handle base64 string (from native SQLite query results - both iOS and Android
// return BLOB data as plain base64 strings through the React Native bridge)
if (typeof logo === 'string') {
return new Uint8Array(Buffer.from(logo, 'base64'));
}
// Handle object-like array conversion (from JSON deserialization)
if (typeof logo === 'object' && !ArrayBuffer.isView(logo) && !Array.isArray(logo)) {
const values = Object.values(logo as Record<string, number>);