File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
web-client/iron-remote-desktop/src Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 71
71
let lastSentClipboardData: ClipboardData | null = null ;
72
72
let lastClipboardMonitorLoopError: Error | null = null ;
73
73
74
+ let componentDestroyed = false ;
75
+
74
76
/* Firefox-specific BEGIN */
75
77
76
78
// See `ffRemoteClipboardData` variable docs below
185
187
186
188
// Called periodically to monitor clipboard changes
187
189
async function onMonitorClipboard() {
188
- if (! document .hasFocus ()) {
189
- setTimeout (onMonitorClipboard , CLIPBOARD_MONITORING_INTERVAL );
190
- return ;
191
- }
192
-
193
190
try {
191
+ if (! document .hasFocus ()) {
192
+ return ;
193
+ }
194
+
194
195
var value = await navigator .clipboard .read ();
195
196
196
197
// Clipboard is empty
291
292
lastClipboardMonitorLoopError = err ;
292
293
}
293
294
} finally {
294
- setTimeout (onMonitorClipboard , CLIPBOARD_MONITORING_INTERVAL );
295
+ if (! componentDestroyed ) {
296
+ setTimeout (onMonitorClipboard , CLIPBOARD_MONITORING_INTERVAL );
297
+ }
295
298
}
296
299
}
297
300
723
726
724
727
onDestroy (() => {
725
728
window .removeEventListener (' resize' , resizeHandler );
729
+ componentDestroyed = true ;
726
730
});
727
731
</script >
728
732
You can’t perform that action at this time.
0 commit comments