From a1658385863caaeb86ebe52784e41d4af900d005 Mon Sep 17 00:00:00 2001 From: Matthias Behr Date: Mon, 4 Jan 2021 17:25:00 +0100 Subject: [PATCH] fix(report): queued msgs to webview should be in fifo order If messages had to be queued they've been dequeued in wrong order. This should fix issue #7. Issues: #7 --- src/dltReport.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dltReport.ts b/src/dltReport.ts index 6a6ced2f..b3efb38f 100644 --- a/src/dltReport.ts +++ b/src/dltReport.ts @@ -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}`); @@ -400,4 +400,4 @@ export class DltReport implements vscode.Disposable { } } -} \ No newline at end of file +}