mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-02-07 04:43:00 -05:00
Fix Logo parsing in React Native to support string/base64 matching (#1622)
This commit is contained in:
committed by
Leendert de Borst
parent
41aa5e9610
commit
67dfc2f495
@@ -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>);
|
||||
|
||||
Reference in New Issue
Block a user