Skip to content

Commit

Permalink
fix: add premium
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Nobbelin committed Sep 14, 2023
1 parent cb053f8 commit 41d98e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/account/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace account {
}

void Account::addPremiumDays(const int32_t &days) {
uint32_t timeLeft = static_cast<int>((m_account.premiumLastDay - getTimeNow()) % 86400);
auto timeLeft = static_cast<int32_t>((m_account.premiumLastDay - getTimeNow()) % 86400);
setPremiumDays(m_account.premiumRemainingDays + days);

if (timeLeft > 0) {
Expand Down Expand Up @@ -199,8 +199,8 @@ namespace account {

time_t currentTime = getTimeNow();

uint32_t daysLeft = static_cast<int>((lastDay - currentTime) / 86400);
uint32_t timeLeft = static_cast<int>((lastDay - currentTime) % 86400);
auto daysLeft = static_cast<int32_t>((lastDay - currentTime) / 86400);
auto timeLeft = static_cast<int32_t>((lastDay - currentTime) % 86400);

m_account.premiumRemainingDays = daysLeft > 0 ? daysLeft : 0;

Expand Down

0 comments on commit 41d98e4

Please sign in to comment.