Skip to content

Commit 2c1217d

Browse files
authored
Fix roundDuration to use absolute value (#11)
önceki pr'da #10 [burayı](https://github.com/psychonaut-station/website/blob/e7aec9f8e65ac158fecb4136341a0a1fe99506b7/app/ui/server-list.tsx#L70) unutmuşum ama onun yerine fonksiyonu değiştireyim
1 parent 014fb41 commit 2c1217d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/lib/conversion.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export function gameState(gamestate: number) {
1818
}
1919

2020
export function roundDuration(seconds: number) {
21+
seconds = Math.abs(seconds);
22+
2123
const minutes = Math.floor(seconds / 60);
2224
const hours = Math.floor(minutes / 60);
2325

app/ui/server-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function Server({ status }: ServerProps) {
4040
const interval = setInterval(() => {
4141
duration += 1;
4242
if (durationRef.current) {
43-
durationRef.current.textContent = roundDuration(Math.abs(duration));
43+
durationRef.current.textContent = roundDuration(duration);
4444
}
4545
}, 1_000);
4646

0 commit comments

Comments
 (0)