Skip to content

Commit

Permalink
Remove unneeded function call
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Oct 23, 2024
1 parent d8087a4 commit 9a4e8ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions flutter_package/lib/src/interface_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ void setCompiledLibPathReal(String path) {
Future<void> prepareInterfaceReal(
AssignRustSignal assignRustSignal,
) async {
// Check and create the namespace JavaScript object.
// Check if the web app was already loaded.
// This step is important because Dart has hot restart.
checkIfAlreadyLoaded();
createRinfBindingsObject();

// Listen to Rust via JavaScript.
rinfBindingsObject['send_rust_signal_extern'] = (
Expand Down
4 changes: 2 additions & 2 deletions flutter_package/lib/src/load_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void setJsLibPath(String path) {
}

bool wasAlreadyLoaded = false;
js.JsObject rinfBindingsObject = createRinfBindingsObject();
js.JsObject rinfBindingsObject = getRinfBindingsObject();
js.JsObject wasmBindingsObject = js.context['wasmBindings'];

/// When Dart performs hot restart,
Expand All @@ -24,7 +24,7 @@ void checkIfAlreadyLoaded() {
/// Create the namespace JavaScript object.
/// This namespace object is used by Rust
/// to call functions defined in Dart.
js.JsObject createRinfBindingsObject() {
js.JsObject getRinfBindingsObject() {
// Create a new `rinfBindings` JavaScript object if not present.
// Otherwise, return the existing one.
final js.JsObject jsObject;
Expand Down

0 comments on commit 9a4e8ab

Please sign in to comment.