mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor: remove invisible subtitle overlay code
This commit is contained in:
@@ -9,16 +9,11 @@ import type {
|
||||
|
||||
type InitializeOverlayRuntimeCore = (options: {
|
||||
backendOverride: string | null;
|
||||
getInitialInvisibleOverlayVisibility: () => boolean;
|
||||
createMainWindow: () => void;
|
||||
createInvisibleWindow: () => void;
|
||||
registerGlobalShortcuts: () => void;
|
||||
updateVisibleOverlayBounds: (geometry: WindowGeometry) => void;
|
||||
updateInvisibleOverlayBounds: (geometry: WindowGeometry) => void;
|
||||
isVisibleOverlayVisible: () => boolean;
|
||||
isInvisibleOverlayVisible: () => boolean;
|
||||
updateVisibleOverlayVisibility: () => void;
|
||||
updateInvisibleOverlayVisibility: () => void;
|
||||
getOverlayWindows: () => BrowserWindow[];
|
||||
syncOverlayShortcuts: () => void;
|
||||
setWindowTracker: (tracker: BaseWindowTracker | null) => void;
|
||||
@@ -35,20 +30,18 @@ type InitializeOverlayRuntimeCore = (options: {
|
||||
data: KikuFieldGroupingRequestData,
|
||||
) => Promise<KikuFieldGroupingChoice>;
|
||||
getKnownWordCacheStatePath: () => string;
|
||||
}) => { invisibleOverlayVisible: boolean };
|
||||
}) => void;
|
||||
|
||||
export function createInitializeOverlayRuntimeHandler(deps: {
|
||||
isOverlayRuntimeInitialized: () => boolean;
|
||||
initializeOverlayRuntimeCore: InitializeOverlayRuntimeCore;
|
||||
buildOptions: () => Parameters<InitializeOverlayRuntimeCore>[0];
|
||||
setInvisibleOverlayVisible: (visible: boolean) => void;
|
||||
setOverlayRuntimeInitialized: (initialized: boolean) => void;
|
||||
startBackgroundWarmups: () => void;
|
||||
}) {
|
||||
return (): void => {
|
||||
if (deps.isOverlayRuntimeInitialized()) return;
|
||||
const result = deps.initializeOverlayRuntimeCore(deps.buildOptions());
|
||||
deps.setInvisibleOverlayVisible(result.invisibleOverlayVisible);
|
||||
deps.initializeOverlayRuntimeCore(deps.buildOptions());
|
||||
deps.setOverlayRuntimeInitialized(true);
|
||||
deps.startBackgroundWarmups();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user