Skip to content

Commit 2e1bf8d

Browse files
committed
fix: reset yt-dlp update info after successful download
After downloading/updating yt-dlp, reset ytdlpChannelUpdateInfo to show 'Up to date' instead of still showing 'X.X.X available'
1 parent 1745eab commit 2e1bf8d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/contexts/DependenciesContext.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,21 @@ export function DependenciesProvider({ children }: { children: ReactNode }) {
228228
setChannelError(null);
229229
setChannelDownloadSuccess(false);
230230
try {
231-
await invoke<string>('download_ytdlp_channel', { channel });
231+
const newVersion = await invoke<string>('download_ytdlp_channel', { channel });
232232
setChannelDownloadSuccess(true);
233233
// Refresh all versions to update UI
234234
await refreshAllYtdlpVersions();
235235
// If current channel is the one we downloaded, refresh main version too
236236
if (channel === ytdlpChannel) {
237237
await refreshYtdlpVersion();
238238
}
239+
// Reset update info to show "Up to date" instead of "available"
240+
setYtdlpChannelUpdateInfo({
241+
channel: channel,
242+
current_version: newVersion,
243+
latest_version: newVersion,
244+
update_available: false,
245+
});
239246
// Hide success message after 3 seconds
240247
setTimeout(() => setChannelDownloadSuccess(false), 3000);
241248
} catch (err) {

0 commit comments

Comments
 (0)