mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Refactor duplicate feed refresh logic into unified refreshFeed method
- Unify `refreshForYouFeed`, `refreshKidsFeed`, `refreshExploreFeed`, and `refreshRecentFeed` into `refreshFeed(feedType, options)`. - Update `js/app/feedCoordinator.js` to implement `refreshFeed` and use it in `loadFeedVideos`. - Update `js/app.js` to delegate specific methods to `refreshFeed`. - Add `FEED_TYPES` import to `js/app.js`. - Update `tests/app/feedCoordinator.test.mjs` to match the refactoring. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
566c2dbf89
commit
b094d2a035
3 files changed
+99
-234
No files matched your search
@@ -22,6 +22,7 @@ import {
|
||||
DEFAULT_BLUR_THRESHOLD,
|
||||
DEFAULT_TRUSTED_MUTE_HIDE_THRESHOLD,
|
||||
DEFAULT_TRUSTED_SPAM_HIDE_THRESHOLD,
|
||||
FEED_TYPES,
|
||||
} from "./constants.js";
|
||||
import { attachHealthBadges } from "./gridHealth.js";
|
||||
import { attachUrlHealthBadges } from "./urlHealthObserver.js";
|
||||
@@ -3946,22 +3947,22 @@ class Application {
|
||||
|
||||
async refreshForYouFeed(...args) {
|
||||
this._initCoordinators();
|
||||
return this._feed.refreshForYouFeed(...args);
|
||||
return this._feed.refreshFeed(FEED_TYPES.FOR_YOU, ...args);
|
||||
}
|
||||
|
||||
refreshKidsFeed(...args) {
|
||||
this._initCoordinators();
|
||||
return this._feed.refreshKidsFeed(...args);
|
||||
return this._feed.refreshFeed(FEED_TYPES.KIDS, ...args);
|
||||
}
|
||||
|
||||
refreshExploreFeed(...args) {
|
||||
this._initCoordinators();
|
||||
return this._feed.refreshExploreFeed(...args);
|
||||
return this._feed.refreshFeed(FEED_TYPES.EXPLORE, ...args);
|
||||
}
|
||||
|
||||
refreshRecentFeed(...args) {
|
||||
this._initCoordinators();
|
||||
return this._feed.refreshRecentFeed(...args);
|
||||
return this._feed.refreshFeed("recent", ...args);
|
||||
}
|
||||
|
||||
checkRelayHealthWarning(...args) {
|
||||
|
||||
Reference in new issue
Block a user