diff options
author | 2023-09-13 20:08:55 +0200 | |
---|---|---|
committer | 2023-09-13 20:08:55 +0200 | |
commit | fbd86a7cc3c791a161f150f3e2a07d7432a5b39c (patch) | |
tree | a42840026fc3f574d1b027804fcb70c7d28609de /subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |
parent | refactor: do not construct uneeded interpretation (diff) | |
download | refinery-fbd86a7cc3c791a161f150f3e2a07d7432a5b39c.tar.gz refinery-fbd86a7cc3c791a161f150f3e2a07d7432a5b39c.tar.zst refinery-fbd86a7cc3c791a161f150f3e2a07d7432a5b39c.zip |
fix(frontend): keep live while model generation
Do not close the connection in a background tab if the model generation is still
running, because closing the connection will immediately cancel generation.
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextWebSocketClient.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/XtextWebSocketClient.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts index 963c1d4c..bb84223c 100644 --- a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts +++ b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |||
@@ -270,6 +270,12 @@ export default class XtextWebSocketClient { | |||
270 | return promise; | 270 | return promise; |
271 | } | 271 | } |
272 | 272 | ||
273 | setKeepAlive(keepAlive: boolean): void { | ||
274 | this.interpreter.send({ | ||
275 | type: keepAlive ? 'GENERATION_STARTED' : 'GENERATION_ENDED', | ||
276 | }); | ||
277 | } | ||
278 | |||
273 | private updateVisibility(): void { | 279 | private updateVisibility(): void { |
274 | this.interpreter.send(document.hidden ? 'TAB_HIDDEN' : 'TAB_VISIBLE'); | 280 | this.interpreter.send(document.hidden ? 'TAB_HIDDEN' : 'TAB_VISIBLE'); |
275 | } | 281 | } |