From 6a86e46da099e09a4e206973ddbd4fd124f1cc26 Mon Sep 17 00:00:00 2001 From: Tarek Date: Sun, 8 Sep 2024 12:29:02 +0300 Subject: [PATCH] feat(frontend): log success message Signed-off-by: Tarek --- packages/app/src/app.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/app/src/app.ts b/packages/app/src/app.ts index e61aed6..89aaf90 100644 --- a/packages/app/src/app.ts +++ b/packages/app/src/app.ts @@ -170,11 +170,11 @@ export default class App { { source: code } ); + // If the compilation was successful, download the wasm blob and print a success message if (result.type === 'OK' && result.payload.type === 'SUCCESS') { - client.notify(proto.LogMessageNotification.type.method, { - type: proto.MessageType.Info, - message: "Compilation successful", - }); + client.printToConsole(proto.MessageType.Info, "Compilation successful"); + const wasm = result.payload.payload.wasm; + downloadBlob(wasm); } else { let message = result.type === 'SERVER_ERROR' ? `Server error: ${result.payload.status}` @@ -182,11 +182,7 @@ export default class App { client.printToConsole(proto.MessageType.Error, message); } - // Download the wasm file (result.payload.payload.wasm) - if (result.type === 'OK' && result.payload.type === 'SUCCESS') { - const wasm = result.payload.payload.wasm; - downloadBlob(wasm); - } + })(); });