diff --git a/apps/desktop/electron/src/service/sources.ts b/apps/desktop/electron/src/service/sources.ts index fe9bd12ad..495c0a003 100644 --- a/apps/desktop/electron/src/service/sources.ts +++ b/apps/desktop/electron/src/service/sources.ts @@ -108,30 +108,30 @@ export function syncFile( const nucliaConnector = new NucliaCloud(source.kb); return downloadFileOrLink(sourceId, item).pipe( switchMap((data) => { - if (data.type === 'blob' && data.blob) { - return from(data.blob.arrayBuffer()).pipe( - switchMap((arrayBuffer) => { - try { + try { + if (data.type === 'blob' && data.blob) { + return from(data.blob.arrayBuffer()).pipe( + switchMap((arrayBuffer) => { return nucliaConnector.upload(item.originalId, item.title, { buffer: arrayBuffer, metadata: { ...item.metadata, labels: source.labels }, }); - } catch (err) { - return of({ success: false, message: `${err}` }); - } - }), - ); - } else if (data.type === 'text' && data.text) { - return nucliaConnector.upload(item.originalId, item.title, { - text: data.text, - metadata: { labels: source.labels }, - }); - } else if (data.type === 'link' && data.link) { - return nucliaConnector - .uploadLink(item.originalId, item.title, data.link) - .pipe(map(() => ({ success: true, message: '' }))); - } else { - return of({ success: false, message: '' }); + }), + ); + } else if (data.type === 'text' && data.text) { + return nucliaConnector.upload(item.originalId, item.title, { + text: data.text, + metadata: { labels: source.labels }, + }); + } else if (data.type === 'link' && data.link) { + return nucliaConnector + .uploadLink(item.originalId, item.title, data.link) + .pipe(map(() => ({ success: true, message: '' }))); + } else { + return of({ success: false, message: '' }); + } + } catch (err) { + return of({ success: false, message: `${err}` }); } }), tap((res) => { diff --git a/package.json b/package.json index 36f2678e4..bb42fcb6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuclia", - "version": "2.7.0", + "version": "2.7.1", "license": "MIT", "author": "Nuclia.cloud", "description": "Nuclia frontend apps and libs",