diff --git a/core/src/wasm.cpp b/core/src/wasm.cpp index f11158470e..a0dc5c1f79 100644 --- a/core/src/wasm.cpp +++ b/core/src/wasm.cpp @@ -57,14 +57,9 @@ km_core_keyboard_load_from_blob_wasm( std::string kb_name, const emscripten::val& blob_val ) { - std::vector blob; + std::vector blob = emscripten::convertJSArrayToNumberVector(blob_val); km_core_keyboard* keyboard_ptr = nullptr; - const auto length = blob_val["length"].as(); - blob.resize(length); - - emscripten::val memoryView{emscripten::typed_memory_view(length, blob.data())}; - memoryView.call("set", blob_val); km_core_status retVal = ::keyboard_load_from_blob_internal(kb_name.c_str(), blob, &keyboard_ptr); return new CoreReturn(retVal, keyboard_ptr); }