aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-10-26 15:42:45 +0100
committerGitHub <noreply@github.com>2023-10-26 16:42:45 +0200
commitc8471f6629aabcc887b58947706ee79d6b89bab9 (patch)
treeb313d908399f85af71059f33fa81c695d8cd6e67 /src/main/java/at/hannibal2/skyhanni/utils
parent099d0a4748e6a01a108a79131fe5452fcdcf5313 (diff)
downloadskyhanni-c8471f6629aabcc887b58947706ee79d6b89bab9.tar.gz
skyhanni-c8471f6629aabcc887b58947706ee79d6b89bab9.tar.bz2
skyhanni-c8471f6629aabcc887b58947706ee79d6b89bab9.zip
Internal Change: Avoid hardcoded dispatcher (#589)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ClipboardUtils.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ClipboardUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ClipboardUtils.kt
index 035259a1a..31008d9b4 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ClipboardUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ClipboardUtils.kt
@@ -14,6 +14,7 @@ import java.awt.datatransfer.UnsupportedFlavorException
import kotlin.time.Duration.Companion.milliseconds
object ClipboardUtils {
+ private var dispatcher = Dispatchers.IO
private var lastClipboardAccessTime = SimpleTimeMark.farPast()
private fun canAccessClipboard(): Boolean {
@@ -55,7 +56,7 @@ object ClipboardUtils {
suspend fun readFromClipboard(step: Int = 0): String? {
try {
return try {
- withContext(Dispatchers.IO) {
+ withContext(dispatcher) {
getClipboard()?.getData(DataFlavor.stringFlavor)?.toString()
}
} catch (e: UnsupportedFlavorException) {