mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-21 12:11:28 -07:00
Harden Yomitan runtime state and profile policy handling
- Centralize external-profile read-only behavior in a shared Yomitan profile policy - Clear parser/extension runtime state via dedicated helpers on load failures and reloads - Prevent opening Yomitan settings when the Yomitan session is unavailable - Add focused runtime-policy and state-clearing regression tests
This commit is contained in:
@@ -24,11 +24,16 @@ export function createOpenYomitanSettingsHandler(deps: {
|
||||
deps.logWarn('Unable to open Yomitan settings: extension failed to load.');
|
||||
return;
|
||||
}
|
||||
const yomitanSession = deps.getYomitanSession?.() ?? null;
|
||||
if (!yomitanSession) {
|
||||
deps.logWarn('Unable to open Yomitan settings: Yomitan session is unavailable.');
|
||||
return;
|
||||
}
|
||||
deps.openYomitanSettingsWindow({
|
||||
yomitanExt: extension,
|
||||
getExistingWindow: deps.getExistingWindow,
|
||||
setWindow: deps.setWindow,
|
||||
yomitanSession: deps.getYomitanSession?.() ?? null,
|
||||
yomitanSession,
|
||||
});
|
||||
})().catch((error) => {
|
||||
deps.logError('Failed to open Yomitan settings window.', error);
|
||||
|
||||
Reference in New Issue
Block a user