diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 665e5084..07aca1a6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -74,13 +74,22 @@ class UserController extends Controller 'msg' => trans('user.sign-success', ['score' => $acuiredScore]), 'score' => $this->user->getScore(), 'storage' => $this->calculatePercentageUsed($this->user->getStorageUsed(), option('score_per_storage')), - 'remaining_time' => round($this->user->getSignRemainingTime() / 3600) + 'remaining_time' => $this->getUserSignRemainingTimeWithPrecision() ]); } else { - return json(trans('user.cant-sign-until', ['time' => round($this->user->getSignRemainingTime() / 3600)]), 1); + return json(trans('user.cant-sign-until', [ + 'time' => $this->getUserSignRemainingTimeWithPrecision() + ]), 1); } } + public function getUserSignRemainingTimeWithPrecision() + { + $hours = $this->user->getSignRemainingTime() / 3600; + + return round($hours) ?: round($hours, 1); + } + public function profile() { return view('user.profile')->with('user', $this->user); diff --git a/plugins b/plugins index b4eeec21..56e0b405 160000 --- a/plugins +++ b/plugins @@ -1 +1 @@ -Subproject commit b4eeec21d9ae5b36d2978b389830ae0f9f4dddcf +Subproject commit 56e0b405985bdc843ec42be80f82a213e2d21198 diff --git a/resources/views/user/index.tpl b/resources/views/user/index.tpl index 7d6012ad..d142ee3a 100644 --- a/resources/views/user/index.tpl +++ b/resources/views/user/index.tpl @@ -75,7 +75,9 @@ @else @endif