Skip to content

Conversation

@samliburd
Copy link

Changes

  • Changed chooseFile() return type from string to Promise<string>

Reason

The Swift implementation shows this method is async (returns a Promise), but the TypeScript definitions have it down as synchronous. This causes TypeScript errors when using await with this method and IINA resolves the file as [object Promise] when not using await.

Evidence

Swift implementation shows Promise-based behavior:

func chooseFile() -> Any {
    return createPromise { resolve, reject in
        // async operation
        resolve.call(withArguments: [result.path])
    }
}

Link to swift file:

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.

1 participant