mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-10 04:49:51 -07:00
feat(config): add configuration window (#70)
This commit is contained in:
@@ -3,6 +3,10 @@ type MpvVisibilityClient = {
|
||||
requestProperty: (name: string) => Promise<unknown>;
|
||||
};
|
||||
|
||||
type RestoreOverlayMpvSubtitlesOptions = {
|
||||
force?: boolean;
|
||||
};
|
||||
|
||||
function parseSubVisibility(value: unknown): boolean {
|
||||
if (typeof value === 'string') {
|
||||
const normalized = value.trim().toLowerCase();
|
||||
@@ -81,11 +85,11 @@ export function createRestoreOverlayMpvSubtitlesHandler(deps: {
|
||||
shouldKeepSuppressedFromVisibleOverlayBinding: () => boolean;
|
||||
setMpvSubVisibility: (visible: boolean) => void;
|
||||
}) {
|
||||
return (): void => {
|
||||
return (options: RestoreOverlayMpvSubtitlesOptions = {}): void => {
|
||||
deps.setRevision(deps.getRevision() + 1);
|
||||
|
||||
const savedVisibility = deps.getSavedSubVisibility();
|
||||
if (deps.shouldKeepSuppressedFromVisibleOverlayBinding()) {
|
||||
if (!options.force && deps.shouldKeepSuppressedFromVisibleOverlayBinding()) {
|
||||
deps.setMpvSubVisibility(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user