Skip to content

Commit 174048c

Browse files
committed
#RIVS-247 - Invalid database is displayed for some period of time after installing the extension
1 parent 3d498fe commit 174048c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/Webview.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ export class WebviewPanel extends Webview implements vscode.Disposable {
147147
opts.column || vscode.ViewColumn.One,
148148
this.getWebviewOptions(),
149149
)
150+
151+
// todo: connection between webviews
152+
if (opts.message) {
153+
await this.panel.webview.postMessage(opts.message)
154+
}
150155
// Update the content
151156
this.update()
152157

@@ -157,11 +162,6 @@ export class WebviewPanel extends Webview implements vscode.Disposable {
157162
this.dispose()
158163
}, null, this._disposables)
159164

160-
// todo: connection between webviews
161-
if (opts.message) {
162-
this.panel.webview.postMessage(opts.message)
163-
}
164-
165165
// Update the content based on view changes
166166
// this.panel.onDidChangeViewState(
167167
// e => {

src/webviews/src/utils/formatters/valueFormatters.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,17 @@ const formattingBuffer = (
124124
}
125125
}
126126
case KeyValueFormat.Vector64Bit: {
127+
const valueUTF = bufferToUTF8(reply)
127128
try {
129+
if (isEqualBuffers(reply, UTF8ToBuffer(valueUTF))) {
130+
return { value: valueUTF, isValid: false }
131+
}
132+
128133
const vector = Array.from(bufferToFloat64Array(reply.data as Uint8Array))
129134
const value = JSONBigInt.stringify(vector)
130135
return JSONViewer({ value, useNativeBigInt: false, ...props })
131136
} catch (e) {
132-
return { value: bufferToUTF8(reply), isValid: false }
137+
return { value: valueUTF, isValid: false }
133138
}
134139
}
135140
case KeyValueFormat.Protobuf: {

0 commit comments

Comments
 (0)