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,4 +1,5 @@
|
||||
import type { NotificationType, OverlayNotificationPayload } from '../../types/notification';
|
||||
import { shouldShowDesktop, shouldShowOverlay, shouldShowOsd } from './notification-routing';
|
||||
|
||||
export interface StartupOsdSequencerCharacterDictionaryEvent {
|
||||
phase: 'checking' | 'generating' | 'syncing' | 'building' | 'importing' | 'ready' | 'failed';
|
||||
@@ -21,18 +22,6 @@ interface StartupStatusNotificationOptions {
|
||||
desktop?: boolean;
|
||||
}
|
||||
|
||||
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';
|
||||
}
|
||||
|
||||
export function createStartupOsdSequencer(deps: StartupOsdSequencerDeps): {
|
||||
reset: () => void;
|
||||
showTokenizationLoading: (message: string) => void;
|
||||
|
||||
Reference in New Issue
Block a user