Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IIFE for injected javascript. #63

Merged
merged 1 commit into from
Feb 23, 2021
Merged

Conversation

tmpfs
Copy link
Contributor

@tmpfs tmpfs commented Feb 23, 2021

Otherwise the global name variable is overriden by the last assigned callback and all function invocations target the last defined callback.

This fixes a bug whereby using multiple callbacks when calling add_window like this:

app.add_window(attrs, Some(vec![ipc, log_error, log_info, log_warn]))?;

Without this fix all javascript function invocations call the Callback named log_warn (the last one defined); after applying this fix each Callback should be invoked as expected.

Otherwise the global `name` variable is overriden by the last assigned
callback and all function invocations target the last defined callback.
@wusyong wusyong merged commit b963030 into tauri-apps:master Feb 23, 2021
@lucasfernog
Copy link
Member

We should have added a change file on this PR, totally forgot that we have covector now :|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants