mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Merge pull request #1122 from PR0M3TH3AN/fix-watch-history-sync-17826641022307563096
Fix watch history sync speed, caching, and deletion persistence
This commit is contained in:
3 files changed
+13
-5
No files matched your search
+3
-1
@@ -2400,7 +2400,9 @@ export function createWatchHistoryRenderer(config = {}) {
|
||||
showFeatureDisabledState();
|
||||
return;
|
||||
}
|
||||
await this.refresh({ ...options, force: true });
|
||||
// Use cached data immediately if available (force: false) unless overridden
|
||||
const force = options.force === true;
|
||||
await this.refresh({ ...options, force });
|
||||
},
|
||||
async ensureInitialLoad(options = {}) {
|
||||
if (!state.initialized) {
|
||||
|
||||
@@ -1640,6 +1640,16 @@ class WatchHistoryManager {
|
||||
WATCH_HISTORY_MAX_ITEMS,
|
||||
);
|
||||
|
||||
// Ensure empty months are preserved so they get cleared on relays
|
||||
if (cachedEntry.records && typeof cachedEntry.records === "object") {
|
||||
const oldKeys = Object.keys(cachedEntry.records);
|
||||
for (const oldKey of oldKeys) {
|
||||
if (!records[oldKey]) {
|
||||
records[oldKey] = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate fingerprint
|
||||
const fingerprint = await this.getFingerprint(resolvedActor, records);
|
||||
const flatItems = Object.values(records).flat();
|
||||
|
||||
@@ -5833,10 +5833,6 @@ export class ProfileModalController {
|
||||
|
||||
try {
|
||||
await renderer.ensureInitialLoad({ actor: primaryActor });
|
||||
await renderer.refresh({
|
||||
actor: primaryActor,
|
||||
force: true,
|
||||
});
|
||||
|
||||
if (!this.boundProfileHistoryVisibility) {
|
||||
this.boundProfileHistoryVisibility = () => {
|
||||
|
||||
Reference in new issue
Block a user