mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-06-09 15:13:32 -07:00
refactor(notifications): extract routing predicates and fix pre-overlay
- Extract shouldShowOsd/Overlay/Desktop into notification-routing.ts (was duplicated in 3 files) - Add resolveOverlayReadinessNotificationType: preserves system channel when overlay not ready (both→osd-system, system→system, overlay→osd) - Route overlay loading status through showConfiguredStatusNotification instead of raw OSD
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { CharacterDictionaryAutoSyncStatusEvent } from './character-dictionary-auto-sync';
|
||||
import type { StartupOsdSequencerCharacterDictionaryEvent } from './startup-osd-sequencer';
|
||||
import type { NotificationType, OverlayNotificationPayload } from '../../types/notification';
|
||||
import { shouldShowDesktop, shouldShowOverlay, shouldShowOsd } from './notification-routing';
|
||||
|
||||
export type CharacterDictionaryAutoSyncNotificationEvent = CharacterDictionaryAutoSyncStatusEvent;
|
||||
|
||||
@@ -16,18 +17,6 @@ export interface CharacterDictionaryAutoSyncNotificationDeps {
|
||||
};
|
||||
}
|
||||
|
||||
function shouldShowOsd(type: NotificationType): boolean {
|
||||
return type === 'osd' || type === 'osd-system';
|
||||
}
|
||||
|
||||
function shouldShowOverlay(type: NotificationType): boolean {
|
||||
return type === 'overlay' || type === 'both';
|
||||
}
|
||||
|
||||
function shouldShowDesktop(type: NotificationType): boolean {
|
||||
return type === 'system' || type === 'both' || type === 'osd-system';
|
||||
}
|
||||
|
||||
function isTerminalPhase(phase: CharacterDictionaryAutoSyncNotificationEvent['phase']): boolean {
|
||||
return phase === 'ready' || phase === 'failed';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user