From b6dffa8e664b036a18e8ae7b953fdf4b2c52507c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 22 Jul 2023 01:33:28 +0000 Subject: [PATCH] Actually return the blob ID from store. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4361 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.js.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ssb.js.c b/src/ssb.js.c index 30b7bc02..9aaf5775 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -216,7 +216,16 @@ typedef struct _blob_store_t void _tf_ssb_blob_store_complete(blob_store_t* store, const char* id) { - JSValue result = JS_Call(store->context, id ? store->promise[0] : store->promise[1], JS_UNDEFINED, 0, NULL); + JSValue result = JS_UNDEFINED; + if (id) + { + JSValue id_value = JS_NewString(store->context, id); + JS_Call(store->context, store->promise[0], JS_UNDEFINED, 1, &id_value); + } + else + { + JS_Call(store->context, store->promise[1], JS_UNDEFINED, 0, NULL); + } tf_util_report_error(store->context, result); JS_FreeValue(store->context, result); JS_FreeValue(store->context, store->promise[0]);