mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 10:52:27 +00:00
Fix: Ensure history pane refreshes on subsequent visits
This change ensures that the profile history pane refreshes its content when the user navigates back to it, addressing a bug where stale data could be displayed.
It implements an optimized strategy:
- On the first load, `ensureInitialLoad` is called, which handles the initial fetch internally.
- On subsequent visits (when the renderer is already initialized), `refresh({ force: true })` is called explicitly to update the list.
The unit test `history pane lazily initializes the watch history renderer` was updated to reflect this behavior, verifying that `ensureInitialLoad` is called once and `refresh` is called on subsequent opens.
This commit is contained in:
1 parent
040a5d0976
commit
4bf3605fd2
2 files changed
+46
-11
No files matched your search
@@ -5850,7 +5850,12 @@ export class ProfileModalController {
|
||||
}
|
||||
|
||||
try {
|
||||
await renderer.ensureInitialLoad({ actor: primaryActor });
|
||||
const state = typeof renderer.getState === "function" ? renderer.getState() : {};
|
||||
if (state.initialized) {
|
||||
await renderer.refresh({ actor: primaryActor, force: true });
|
||||
} else {
|
||||
await renderer.ensureInitialLoad({ actor: primaryActor });
|
||||
}
|
||||
|
||||
if (!this.boundProfileHistoryVisibility) {
|
||||
this.boundProfileHistoryVisibility = () => {
|
||||
|
||||
Reference in new issue
Block a user