Skip to content

Commit

Permalink
fix(report): queued msgs to webview should be in fifo order
Browse files Browse the repository at this point in the history
If messages had to be queued they've been dequeued in wrong order.
This should fix issue #7.

Issues: #7
  • Loading branch information
mbehr1 authored Jan 4, 2021
1 parent ed30e49 commit a165838
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dltReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class DltReport implements vscode.Disposable {
// any messages to post?
if (this._msgsToPost.length) {
let msg: any;
while (msg = this._msgsToPost.pop()) {
while (msg = this._msgsToPost.shift()) { // fifo order.
const msgCmd = msg.command;
this.panel?.webview.postMessage(msg).then((onFulFilled) => {
console.log(`webview.postMessage(${msgCmd}) queued ${onFulFilled}`);
Expand Down Expand Up @@ -400,4 +400,4 @@ export class DltReport implements vscode.Disposable {
}

}
}
}

0 comments on commit a165838

Please sign in to comment.