mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-28 15:45:58 +00:00
fix #2
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { clipboard } from 'electron'
|
||||
import { TAG_RARITY } from '../components/parser/constants'
|
||||
|
||||
export async function pollClipboard (delay: number, limit: number): Promise<string> {
|
||||
const textBefore = clipboard.readText()
|
||||
let textBefore = clipboard.readText()
|
||||
let elapsed = 0
|
||||
|
||||
if (textBefore.startsWith(TAG_RARITY)) {
|
||||
textBefore = ''
|
||||
clipboard.writeText('')
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
function poll () {
|
||||
const textAfter = clipboard.readText()
|
||||
|
||||
@@ -23,7 +23,7 @@ export function setupShortcuts () {
|
||||
ioHook.registerShortcut([KEY_CTRL, KEY_D], () => {
|
||||
if (!isPollingClipboard) {
|
||||
isPollingClipboard = true
|
||||
pollClipboard(32, 1750)
|
||||
pollClipboard(32, 1000)
|
||||
.then(async (clipboard) => {
|
||||
win.webContents.send('price-check', clipboard)
|
||||
poeWindowId = await windowManager.getActiveWindowId()
|
||||
|
||||
Reference in New Issue
Block a user