Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real-time status about sync details #569

Merged
merged 17 commits into from
Aug 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plugin/src/App/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function App:startSession()
})

serveSession:onPatchApplied(function(patch, unapplied)
local now = os.time()
local count = 0

for _, set in patch do
Expand All @@ -123,9 +124,15 @@ function App:startSession()
end

if count == 0 then return end

local old = self.patchInfo:getValue()
if now - old.timestamp < 2 then
count += old.updates
boatbomber marked this conversation as resolved.
Show resolved Hide resolved
end

self.setPatchInfo({
updates = count,
timestamp = os.time(),
timestamp = now,
})
end)

Expand Down