Skip to content

Commit

Permalink
Remove PurgedMarkerManager circular dependency
Browse files Browse the repository at this point in the history
PurgedMarkerManager also calls onFilterApplied. Switch to the custom event to
reduce the number of circular dependencies from 4 to 3.
  • Loading branch information
danrahn committed Mar 10, 2024
1 parent f129e07 commit af39557
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Client/Script/PurgedMarkerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { errorMessage, errorResponseOverlay } from './ErrorHandling.js';
import { MarkerConflictResolution, MarkerData, SectionType } from '../../Shared/PlexTypes.js';
import { Theme, ThemeColors } from './ThemeColors.js';
import ButtonCreator from './ButtonCreator.js';
import { CustomEvents } from './CustomEvents.js';
import Icons from './Icons.js';
import Overlay from './Overlay.js';
import { PlexClientState } from './PlexClientState.js';
import { PlexUI } from './PlexUI.js';
import { ServerCommands } from './Commands.js';
import TableElements from './TableElements.js';
import Tooltip from './Tooltip.js';
Expand Down Expand Up @@ -1026,7 +1026,7 @@ class PurgedMarkerManager {

static CreateInstance(findAllEnabled) {
if (PurgeManagerSingleton) {
Log.error('We should only have a single PlexUI instance!');
Log.error('We should only have a single PurgedMarkerManager instance!');
return;
}

Expand Down Expand Up @@ -1199,7 +1199,7 @@ class PurgedMarkerManager {
}

// After everything's updated, reapply the current filter in case the new/removed items affected anything
PlexUI.onFilterApplied();
window.dispatchEvent(new Event(CustomEvents.MarkerFilterApplied));
}

/**
Expand Down

0 comments on commit af39557

Please sign in to comment.