mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Wanted Monitor/Unmonitor Selected button fixed (#528)
* the button was not changing based on the filter selection nor was it properly carrying out its function. It should now work. this code was ported from Sonarr: https://github.com/Sonarr/Sonarr/commit/979fc436ab88be6e0c9a3f1a721eb3b47d85c218 * indents/spaces/formtting
This commit is contained in:
@@ -1,17 +1,27 @@
|
||||
let currentPopulator = null;
|
||||
let currentReasons = [];
|
||||
|
||||
export function registerPagePopulator(populator) {
|
||||
export function registerPagePopulator(populator, reasons = []) {
|
||||
currentPopulator = populator;
|
||||
currentReasons = reasons;
|
||||
}
|
||||
|
||||
export function unregisterPagePopulator(populator) {
|
||||
if (currentPopulator === populator) {
|
||||
currentPopulator = null;
|
||||
currentReasons = [];
|
||||
}
|
||||
}
|
||||
|
||||
export function repopulatePage() {
|
||||
if (currentPopulator) {
|
||||
export function repopulatePage(reason) {
|
||||
if (!currentPopulator) {
|
||||
return;
|
||||
}
|
||||
if (!reason) {
|
||||
currentPopulator();
|
||||
}
|
||||
|
||||
if (reason && currentReasons.includes(reason)) {
|
||||
currentPopulator();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user