mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-25 22:59:10 -04:00
New: Project Aphrodite
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
let currentPopulator = null;
|
||||
let currentReasons = [];
|
||||
|
||||
export function registerPagePopulator(populator, reasons = []) {
|
||||
currentPopulator = populator;
|
||||
currentReasons = reasons;
|
||||
}
|
||||
|
||||
export function unregisterPagePopulator(populator) {
|
||||
if (currentPopulator === populator) {
|
||||
currentPopulator = null;
|
||||
currentReasons = [];
|
||||
}
|
||||
}
|
||||
|
||||
export function repopulatePage(reason) {
|
||||
if (!currentPopulator) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!reason) {
|
||||
currentPopulator();
|
||||
}
|
||||
|
||||
if (reason && currentReasons.includes(reason)) {
|
||||
currentPopulator();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user