From dec7f6cabbe28b044698258a748685b1f0d35398 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 15 Dec 2019 13:26:59 -0500 Subject: Add comment describing what token is used for --- ext/bg/js/search.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/bg/js') diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 3d6024f0..de2bca64 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -244,6 +244,9 @@ class DisplaySearch extends Display { } startClipboardMonitor() { + // The token below is used as a unique identifier to ensure that a new clipboard monitor + // hasn't been started during the await call. The check below the await this.getClipboardText() + // call will exit early if the reference has changed. const token = {}; const intervalCallback = async () => { this.clipboardMonitorTimerId = null; -- cgit v1.2.3