Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
fix: add error handling for format loading with retry option in FormatSelector
Tonhobd4c42d866c9
diff --git a/src/components/omnibox/FormatSelector.svelte b/src/components/omnibox/FormatSelector.svelteindex 1adb4ac0..837ca0d3 100644--- a/src/components/omnibox/FormatSelector.svelte+++ b/src/components/omnibox/FormatSelector.svelte@@ -22,6 +22,7 @@formats = $bindable([]),selectedFormatId = $bindable<string | null>(null),loadingFormats = false,+ formatError = null as string | null,onLoadFormats,onSelectFormat,onClearFormat,@@ -83,9 +84,18 @@<path d="M4 6h16M4 12h16M4 18h16" /></svg>{/if}- {$t('omnibox.view_formats')}+ {formats.length > 0 ? $t('omnibox.hide_formats') : $t('omnibox.view_formats')}</button>+ {#if formatError && formats.length === 0}+ <div class="formats-error">+ <span class="formats-error-text">{formatError}</span>+ <button class="button formats-retry-btn" onclick={onLoadFormats}>+ {$t('omnibox.retry')}+ </button>+ </div>+ {/if}+{#if formats.length > 0}{#if !selectedFormatId}<div class="formats-panel">@@ -185,6 +195,34 @@border-width: 1.5px;}+ .formats-error {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--padding);+ padding: calc(var(--padding) / 2) var(--padding);+ background: var(--button-elevated);+ border-radius: calc(var(--border-radius) - 2px);+ border-left: 3px solid var(--red);+ }++ .formats-error-text {+ font-size: 12.5px;+ font-weight: 500;+ color: var(--secondary);+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ .formats-retry-btn {+ font-size: 12.5px;+ padding: 4px 10px;+ flex-shrink: 0;+ }+.formats-panel {display: flex;flex-direction: column;