aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/XtextClient.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-09-06 22:32:04 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-09-08 01:24:50 +0200
commit5f8f4e6484faff23821ca7c009e309382fba914d (patch)
tree6d399fb90b4aa3527c30c502ba474cd83b5c94b2 /subprojects/frontend/src/xtext/XtextClient.ts
parentfeat(frontend): handle page hide events (diff)
downloadrefinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.gz
refinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.zst
refinery-5f8f4e6484faff23821ca7c009e309382fba914d.zip
feat(frontend): check for updates periodically
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextClient.ts')
-rw-r--r--subprojects/frontend/src/xtext/XtextClient.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/subprojects/frontend/src/xtext/XtextClient.ts b/subprojects/frontend/src/xtext/XtextClient.ts
index 1f7e446f..cd5d280d 100644
--- a/subprojects/frontend/src/xtext/XtextClient.ts
+++ b/subprojects/frontend/src/xtext/XtextClient.ts
@@ -4,6 +4,7 @@ import type {
4} from '@codemirror/autocomplete'; 4} from '@codemirror/autocomplete';
5import type { Transaction } from '@codemirror/state'; 5import type { Transaction } from '@codemirror/state';
6 6
7import type PWAStore from '../PWAStore';
7import type EditorStore from '../editor/EditorStore'; 8import type EditorStore from '../editor/EditorStore';
8import getLogger from '../utils/getLogger'; 9import getLogger from '../utils/getLogger';
9 10
@@ -30,7 +31,7 @@ export default class XtextClient {
30 31
31 private readonly occurrencesService: OccurrencesService; 32 private readonly occurrencesService: OccurrencesService;
32 33
33 constructor(store: EditorStore) { 34 constructor(store: EditorStore, private readonly pwaStore: PWAStore) {
34 this.webSocketClient = new XtextWebSocketClient( 35 this.webSocketClient = new XtextWebSocketClient(
35 () => this.onReconnect(), 36 () => this.onReconnect(),
36 () => this.onDisconnect(), 37 () => this.onDisconnect(),
@@ -54,6 +55,7 @@ export default class XtextClient {
54 private onReconnect(): void { 55 private onReconnect(): void {
55 this.updateService.onReconnect(); 56 this.updateService.onReconnect();
56 this.occurrencesService.onReconnect(); 57 this.occurrencesService.onReconnect();
58 this.pwaStore.checkForUpdates();
57 } 59 }
58 60
59 private onDisconnect(): void { 61 private onDisconnect(): void {