mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
fix: add missing rendererReady call and fix temporal dead zone crash
- App.tsx: call electronAPI.file.rendererReady() on mount so main process opens pendingFile (files passed via CLI or file associations) - FindReplaceBar: move updateMatchCount declaration before executeCommand to fix 'Cannot access d before initialization' crash in minified build (executeCommand referenced updateMatchCount via closure before its const declaration in the same scope)
This commit is contained in:
@@ -15,6 +15,10 @@ function App() {
|
||||
useAutoUpdateCheck();
|
||||
const [printOpen, setPrintOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
window.electronAPI?.file?.rendererReady?.();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const handler = () => setPrintOpen(true);
|
||||
window.addEventListener('mc:print', handler);
|
||||
|
||||
Reference in New Issue
Block a user