Skip to content

Commit

Permalink
feat(frontend): log success message
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <tareknaser360@gmail.com>
  • Loading branch information
tareknaser committed Sep 8, 2024
1 parent b32643c commit 6a86e46
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/app/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,19 @@ 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}`
: 'Network error';
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);
}

})();
});

Expand Down

0 comments on commit 6a86e46

Please sign in to comment.