mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat(api): implement API configuration validation and error handling in home screen and update section
This commit is contained in:
@@ -195,7 +195,7 @@ const VideoCard = forwardRef<View, VideoCardProps>(
|
||||
{isContinueWatching && (
|
||||
<View style={styles.infoRow}>
|
||||
<ThemedText style={styles.continueLabel}>
|
||||
第{episodeIndex! + 1}集 已观看 {Math.round((progress || 0) * 100)}%
|
||||
第{episodeIndex}集 已观看 {Math.round((progress || 0) * 100)}%
|
||||
</ThemedText>
|
||||
</View>
|
||||
)}
|
||||
@@ -343,4 +343,4 @@ const styles = StyleSheet.create({
|
||||
color: Colors.dark.primary,
|
||||
fontSize: 12,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,8 +6,16 @@ import { useUpdateStore } from "@/stores/updateStore";
|
||||
// import { UPDATE_CONFIG } from "@/constants/UpdateConfig";
|
||||
|
||||
export function UpdateSection() {
|
||||
const { currentVersion, remoteVersion, updateAvailable, downloading, downloadProgress, checkForUpdate } =
|
||||
useUpdateStore();
|
||||
const {
|
||||
currentVersion,
|
||||
remoteVersion,
|
||||
updateAvailable,
|
||||
downloading,
|
||||
downloadProgress,
|
||||
checkForUpdate,
|
||||
isLatestVersion,
|
||||
error
|
||||
} = useUpdateStore();
|
||||
|
||||
const [checking, setChecking] = React.useState(false);
|
||||
|
||||
@@ -36,6 +44,20 @@ export function UpdateSection() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{isLatestVersion && remoteVersion && (
|
||||
<View style={styles.row}>
|
||||
<ThemedText style={styles.label}>状态</ThemedText>
|
||||
<ThemedText style={[styles.value, styles.latestVersion]}>已是最新版本</ThemedText>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<View style={styles.row}>
|
||||
<ThemedText style={styles.label}>检查结果</ThemedText>
|
||||
<ThemedText style={[styles.value, styles.errorText]}>{error}</ThemedText>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{downloading && (
|
||||
<View style={styles.row}>
|
||||
<ThemedText style={styles.label}>下载进度</ThemedText>
|
||||
@@ -96,6 +118,14 @@ const styles = StyleSheet.create({
|
||||
color: "#00bb5e",
|
||||
fontWeight: "bold",
|
||||
},
|
||||
latestVersion: {
|
||||
color: "#00bb5e",
|
||||
fontWeight: "500",
|
||||
},
|
||||
errorText: {
|
||||
color: "#ff6b6b",
|
||||
fontWeight: "500",
|
||||
},
|
||||
buttonContainer: {
|
||||
flexDirection: "row",
|
||||
gap: 12,
|
||||
|
||||
Reference in New Issue
Block a user