mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
Merge pull request #17 from 24c02/slack-status-timing
slack status job: make statuses expire in sensible amount of time
This commit is contained in:
commit
eb08d852b2
1 changed files with 2 additions and 2 deletions
|
|
@ -50,7 +50,7 @@ class User < ApplicationRecord
|
|||
current_project_duration = Heartbeat.duration_seconds(current_project_heartbeats)
|
||||
current_project_duration_formatted = Heartbeat.duration_simple(current_project_heartbeats)
|
||||
|
||||
# for 0 duration, don't set a status
|
||||
# for 0 duration, don't set a status – this will let status expire when the user has not been cooking today
|
||||
return if current_project_duration.zero?
|
||||
|
||||
status_emoji =
|
||||
|
|
@ -84,7 +84,7 @@ class User < ApplicationRecord
|
|||
profile: {
|
||||
status_text:,
|
||||
status_emoji:,
|
||||
status_expiration: Date.today.to_time.to_i + (1.hour.to_i * 1000)
|
||||
status_expiration: (Time.now + 30.minutes).to_i
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue