Fix <Text> error
This commit is contained in:
parent
c8271d19a9
commit
ad663b105b
2 changed files with 25 additions and 22 deletions
32
bun.lock
32
bun.lock
|
|
@ -4,24 +4,24 @@
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/helpers": "latest",
|
"@swc/helpers": "^0.5.18",
|
||||||
"serve": "latest",
|
"serve": "^14.2.5",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "latest",
|
"@rollup/plugin-commonjs": "^29.0.0",
|
||||||
"@rollup/plugin-node-resolve": "latest",
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||||
"@swc/core": "latest",
|
"@swc/core": "^1.15.11",
|
||||||
"@types/react": "latest",
|
"@types/react": "^19.2.10",
|
||||||
"@types/react-native": "latest",
|
"@types/react-native": "^0.73.0",
|
||||||
"@typescript-eslint/eslint-plugin": "latest",
|
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
||||||
"@typescript-eslint/parser": "latest",
|
"@typescript-eslint/parser": "^8.54.0",
|
||||||
"esbuild": "latest",
|
"esbuild": "^0.27.2",
|
||||||
"eslint": "latest",
|
"eslint": "^9.39.2",
|
||||||
"eslint-plugin-react": "latest",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"rollup": "latest",
|
"rollup": "^4.57.1",
|
||||||
"rollup-plugin-esbuild": "latest",
|
"rollup-plugin-esbuild": "^6.2.1",
|
||||||
"typescript": "latest",
|
"typescript": "^5.9.3",
|
||||||
"vendetta-types": "latest",
|
"vendetta-types": "^2.4.21",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ export default function RPCPreview() {
|
||||||
try {
|
try {
|
||||||
const primaryArtist = artists[0] || "Unknown Artist";
|
const primaryArtist = artists[0] || "Unknown Artist";
|
||||||
const trackInfoResponse = await fetch(
|
const trackInfoResponse = await fetch(
|
||||||
`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${getStorage("apiKey")}&artist=${encodeURIComponent(primaryArtist)}&track=${encodeURIComponent(track.name)}&format=json&username=${getStorage("username")}`,
|
`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${getStorage("apiKey")}&artist=${encodeURIComponent(primaryArtist)}&track=${encodeURIComponent(track.name)}&format=json&u[...]`
|
||||||
);
|
);
|
||||||
const trackInfo = await trackInfoResponse.json();
|
const trackInfo = await trackInfoResponse.json();
|
||||||
if (trackInfo.track && trackInfo.track.duration) {
|
if (trackInfo.track && trackInfo.track.duration) {
|
||||||
|
|
@ -195,8 +195,11 @@ export default function RPCPreview() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Store getStorage calls with defaults to prevent undefined rendering
|
||||||
const activityType = getStorage("listeningTo") ? "Listening to" : "Playing";
|
const activityType = getStorage("listeningTo") ? "Listening to" : "Playing";
|
||||||
const appName = getStorage("appName", "Music");
|
const appName = getStorage("appName") || "Music";
|
||||||
|
const showLargeText = getStorage("showLargeText", true);
|
||||||
|
const showTimestamp = getStorage("showTimestamp", false);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -251,13 +254,13 @@ export default function RPCPreview() {
|
||||||
<RN.Text style={styles.artistName} numberOfLines={1}>
|
<RN.Text style={styles.artistName} numberOfLines={1}>
|
||||||
{previewTrack.artist}
|
{previewTrack.artist}
|
||||||
</RN.Text>
|
</RN.Text>
|
||||||
{getStorage("showLargeText") && previewText !== "No tooltip text" && (
|
{showLargeText && previewText !== "No tooltip text" && (
|
||||||
<RN.Text style={styles.tooltipText} numberOfLines={1}>
|
<RN.Text style={styles.tooltipText} numberOfLines={1}>
|
||||||
{previewText}
|
{previewText}
|
||||||
</RN.Text>
|
</RN.Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{getStorage("showTimestamp") && previewTrack.duration && (
|
{showTimestamp && previewTrack.duration ? (
|
||||||
<RN.View style={styles.progressContainer}>
|
<RN.View style={styles.progressContainer}>
|
||||||
<RN.Text style={styles.timeText}>
|
<RN.Text style={styles.timeText}>
|
||||||
{formatTime(progressData.current)}
|
{formatTime(progressData.current)}
|
||||||
|
|
@ -274,7 +277,7 @@ export default function RPCPreview() {
|
||||||
{formatTime(progressData.total)}
|
{formatTime(progressData.total)}
|
||||||
</RN.Text>
|
</RN.Text>
|
||||||
</RN.View>
|
</RN.View>
|
||||||
)}
|
) : null}
|
||||||
</RN.View>
|
</RN.View>
|
||||||
</RN.View>
|
</RN.View>
|
||||||
</RN.View>
|
</RN.View>
|
||||||
|
|
@ -419,4 +422,4 @@ const styles = RN.StyleSheet.create({
|
||||||
minWidth: 35,
|
minWidth: 35,
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Loading…
Add table
Reference in a new issue