Skip to content

Commit e11edd2

Browse files
committed
refactor: モバイルコンパニオンの不要なデバッグ計装およびヘルパー関数を削除し、コード変更を整理
1 parent 8901bb3 commit e11edd2

3 files changed

Lines changed: 15 additions & 87 deletions

File tree

src/lib/mobileCompanionDate.test.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/lib/mobileCompanionDate.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/views/MobileCompanion.svelte

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts">
22
import { onDestroy, onMount, tick } from "svelte";
3-
import { safeFormatLastPlay, safeFormatSyncTime } from "@/lib/mobileCompanionDate";
43
import { MOBILE_COMPANION_CLIENT_VERSION } from "@/lib/mobileCompanionUrl";
54
import { saveImageToCache, getAllCachedImages } from "@/lib/imageCache";
65
import type {
@@ -558,6 +557,7 @@
558557
if (activeView === "detail") {
559558
activeView = "controller";
560559
}
560+
561561
if (shouldLoadMemo) {
562562
memoText = "";
563563
sendMessage({ type: "init", gameId: target.id });
@@ -653,9 +653,21 @@
653653
return `${Math.floor((seconds / 3600) * 10) / 10}時間`;
654654
};
655655
656-
const formatLastPlay = (value: string | null) => safeFormatLastPlay(value);
656+
const formatLastPlay = (value: string | null) => {
657+
if (!value) return "未プレイ";
658+
return new Date(value).toLocaleDateString("ja-JP", {
659+
month: "2-digit",
660+
day: "2-digit",
661+
});
662+
};
657663
658-
const formatSyncTime = (value: string | null) => safeFormatSyncTime(value);
664+
const formatSyncTime = (value: string | null) => {
665+
if (!value) return "未同期";
666+
return new Date(value).toLocaleTimeString("ja-JP", {
667+
hour: "2-digit",
668+
minute: "2-digit",
669+
});
670+
};
659671
660672
const applyLibrary = (nextGames: RemoteGameSummary[]) => {
661673
const syncedAt = new Date().toISOString();
@@ -1304,7 +1316,6 @@
13041316
background: rgb(255 255 255 / 0.045);
13051317
}
13061318
1307-
13081319
.section,
13091320
.library-view,
13101321
.detail-panel,
@@ -1400,7 +1411,6 @@
14001411
color: #b7f3cb;
14011412
}
14021413
1403-
14041414
.library-toolbar {
14051415
display: flex;
14061416
align-items: end;

0 commit comments

Comments
 (0)