feat: optimized logic of render. Rerender changed to setProperty

This commit is contained in:
Савелий Савенок
2024-11-19 20:56:36 +03:00
parent 24e919cdd6
commit f16700a9db
3 changed files with 22 additions and 15 deletions

View File

@@ -76,14 +76,13 @@ export function RenderExpireBar(position, createdTime, fetchTime) {
const yPos = getYPos(position)
const expireDif = Math.abs((((Date.now() - createdTime) / 1000)
/ fetchTime) - 1)
return createWidget(widget.ARC, {
x: buttonWidth - 50,
y: yPos + 52,
w: 40,
h: 40,
line_width: 5,
color: 0x1ca9c9,
color: expireDif > 0.25 ? 0x1ca9c9 : 0xfa0404,
start_angle: -90,
end_angle: (expireDif * 360) - 90,
text: expireDif