mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1251 from c0mpile/pr/wallhaven-browse-state-persistence
fix: Retain current page when re-initializing or switching to Wallhaven wallpaper source.
This commit is contained in:
@@ -494,9 +494,10 @@ SmartPanel {
|
||||
panelContent.updateWallhavenResolution();
|
||||
|
||||
// If the view is already initialized, trigger a new search when switching to it
|
||||
// Preserve current page when switching back to Wallhaven source
|
||||
if (wallhavenView && wallhavenView.initialized && !WallhavenService.fetching) {
|
||||
wallhavenView.loading = true;
|
||||
WallhavenService.search(Settings.data.wallpaper.wallhavenQuery || "", 1);
|
||||
WallhavenService.search(Settings.data.wallpaper.wallhavenQuery || "", WallhavenService.currentPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1048,8 +1049,9 @@ SmartPanel {
|
||||
}
|
||||
|
||||
// Now check if we can actually search (fetching check is in WallhavenService.search)
|
||||
// Use persisted currentPage to maintain state across window reopening
|
||||
loading = true;
|
||||
WallhavenService.search(Settings.data.wallpaper.wallhavenQuery || "", 1);
|
||||
WallhavenService.search(Settings.data.wallpaper.wallhavenQuery || "", WallhavenService.currentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user