feat(update): add toast notifications for update failures

- Add toast error messages when version check fails
- Show user-friendly error notifications for download failures
- Display specific installation error messages with troubleshooting hints
- Improve logging from console.error to console.info for better categorization
This commit is contained in:
zimplexing
2025-08-13 18:58:32 +08:00
parent df8fae96ac
commit fc81de1728
4 changed files with 21 additions and 12 deletions

View File

@@ -124,7 +124,7 @@ const usePlayerStore = create<PlayerState>((set, get) => ({
try {
await videoRef?.current?.replayAsync();
} catch (error) {
console.error("Failed to replay video:", error);
console.info("Failed to replay video:", error);
Toast.show({ type: "error", text1: "播放失败" });
}
}
@@ -140,7 +140,7 @@ const usePlayerStore = create<PlayerState>((set, get) => ({
await videoRef?.current?.playAsync();
}
} catch (error) {
console.error("Failed to toggle play/pause:", error);
console.info("Failed to toggle play/pause:", error);
Toast.show({ type: "error", text1: "操作失败" });
}
}
@@ -154,7 +154,7 @@ const usePlayerStore = create<PlayerState>((set, get) => ({
try {
await videoRef?.current?.setPositionAsync(newPosition);
} catch (error) {
console.error("Failed to seek video:", error);
console.info("Failed to seek video:", error);
Toast.show({ type: "error", text1: "快进/快退失败" });
}