From f621d181f894071a15c90b68efdd3f4830182036 Mon Sep 17 00:00:00 2001 From: "Paul H. Liu" Date: Fri, 18 Jun 2021 17:39:38 -0700 Subject: [PATCH] Add a copy button --- src/bare-agent.js | 9 ++++++--- src/index.html | 1 + src/index.js | 26 ++++++++++++++++++++------ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/bare-agent.js b/src/bare-agent.js index e0fd251..0c085b9 100644 --- a/src/bare-agent.js +++ b/src/bare-agent.js @@ -149,7 +149,7 @@ export async function send_message(message, update_status, sleep) { let canister_id = new Principal(ingress.content.canister_id).toString(); let method_name = ingress.content.method_name; let reply = await query(canister_id, ingress_content); - update_status(await try_decode(canister_id, method_name, reply)); + update_status(await try_decode(canister_id, method_name, reply), true); } else { // Update call, handle json format of both nano and dfx const ingress_content = fromHexString( @@ -184,9 +184,12 @@ export async function send_message(message, update_status, sleep) { continue; } else { if (reply.status == "replied") { - update_status(await try_decode(canister_id, method_name, reply)); + update_status( + await try_decode(canister_id, method_name, reply), + true + ); } else { - update_status(reply); + update_status(reply, true); } break; } diff --git a/src/index.html b/src/index.html index 99b2dfc..07b8268 100644 --- a/src/index.html +++ b/src/index.html @@ -8,6 +8,7 @@