From fabd09f26731dcb4d42364d919b7d9bff186e6eb Mon Sep 17 00:00:00 2001 From: vyfor Date: Thu, 9 Jan 2025 15:48:42 +0500 Subject: [PATCH] fix(manager): fixed timestamp logic --- lua/cord/plugin/activity/manager.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/cord/plugin/activity/manager.lua b/lua/cord/plugin/activity/manager.lua index 8a98d26b..088770e7 100644 --- a/lua/cord/plugin/activity/manager.lua +++ b/lua/cord/plugin/activity/manager.lua @@ -224,8 +224,6 @@ end ---Update the activity ---@return nil function ActivityManager:update_activity() - if self:should_update_time() then self.opts.timestamp = os.time() end - self.is_idle = false self.is_force_idle = false self.last_opts = self.opts @@ -498,7 +496,14 @@ function ActivityManager:build_opts() is_focused = self.is_focused, is_idle = self.is_idle, } - if self.config.timestamp.enabled then opts.timestamp = os.time() end + if self.config.timestamp.enabled then + if self.last_opts and self.last_opts.timestamp then + opts.timestamp = self.last_opts.timestamp + else + opts.timestamp = os.time() + end + end + if self:should_update_time() then opts.timestamp = os.time() end local buttons = config_utils:get_buttons(opts) opts.buttons = buttons