Hi @v-siky-msft ,
Sure, I created a button and on button click, I trigger function that should obtain the file. Inside the function, I am just using context.device.pickFile and it always executes successfully and returns undefined as a result.
this._pickFileBtn = document.createElement('button');
this._pickFileBtn.innerText = "Select Audio";
this._pickFileBtn.onclick = () => this.getAudioFile();
private getAudioFile() {
this._context.device.pickFile().then(
(result) => this.setAudioFile(result),
(e) => console.error("Error occured:", e)
);
}
context.device.pickFile works fine when I use it in real environment.
I checked out how context.device.pickFile is executed in harness and can see that it return Promise with undefined value under the hood.