This commit is contained in:
sxyazi
2025-07-02 23:35:50 +08:00
parent 2ad42fa706
commit e5f00e2716
5 changed files with 105 additions and 64 deletions

View File

@@ -7,7 +7,12 @@ local toggle_ui = ya.sync(function(self)
else
self.children = Modal:children_add(self, 10)
end
ya.render()
-- TODO: remove this
if ui.render then
ui.render()
else
ya.render()
end
end)
local subscribe = ya.sync(function(self)
@@ -18,7 +23,12 @@ end)
local update_partitions = ya.sync(function(self, partitions)
self.partitions = partitions
self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1))
ya.render()
-- TODO: remove this
if ui.render then
ui.render()
else
ya.render()
end
end)
local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end)
@@ -29,7 +39,12 @@ local update_cursor = ya.sync(function(self, cursor)
else
self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1)
end
ya.render()
-- TODO: remove this
if ui.render then
ui.render()
else
ya.render()
end
end)
local M = {