Skip to content

Commit

Permalink
- Test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleG committed Oct 31, 2024
1 parent 7d5910e commit fa1331a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Zframework/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ if JS then
))
end

local timeout = 0.2
love.system.getClipboardText = function ()
local res
JS.newPromiseRequest(JS.stringFunc(
Expand All @@ -212,10 +213,12 @@ if JS then
});
]]
), function(data) print("In callback: " .. data); res=data end)
print(timeout)
repeat
love.timer.sleep(0.1)
JS.retrieveData(0.1)
love.timer.sleep(timeout)
JS.retrieveData(timeout)
until res
timeout = timeout * 0.95
return res
end
end
Expand Down

0 comments on commit fa1331a

Please sign in to comment.