fix(offline): correct event names for cache completion

Frontend was listening for wrong event names:
- offline:cached → offline:caching_completed
- offline:cache_failed → offline:caching_failed

Also added "Open cache folder" button to Settings.
This commit is contained in:
vicrodh committed 2026-01-27 19:01:08 -06:00
1 parent 900df9307a
commit 4b975869df
2 files changed
+24 -3

No files matched your search

+22 -1
View File
@@ -1570,6 +1570,15 @@
}
}
async function handleOpenCacheFolder() {
try {
await invoke('open_offline_cache_folder');
} catch (err) {
console.error('Failed to open cache folder:', err);
showToast('Failed to open cache folder', 'error');
}
}
async function handleClearCache() {
if (isClearing) return;
isClearing = true;
@@ -2107,7 +2116,7 @@
{isRepairingDownloads ? 'Repairing...' : 'Repair'}
</button>
</div>
<div class="setting-row last">
<div class="setting-row">
<span class="setting-label">Clear Offline Library</span>
<button
class="clear-btn"
@@ -2117,6 +2126,18 @@
{isClearingDownloads ? 'Clearing...' : 'Clear All'}
</button>
</div>
<div class="setting-row last">
<div class="setting-with-description">
<span class="setting-label">Manage Offline Cache</span>
<span class="setting-description">Open the cache folder in your file manager</span>
</div>
<button
class="clear-btn"
onclick={handleOpenCacheFolder}
>
Open Folder
</button>
</div>
</section>
<!-- Library Section -->