mirror of
https://github.com/ershisan99/md-preview-desktop.git
synced 2025-12-31 05:09:28 +00:00
chore: fix build by using yarn instead of pnpm
This commit is contained in:
@@ -52,6 +52,12 @@ function createWindow(): void {
|
||||
}
|
||||
}
|
||||
|
||||
if (is.dev) {
|
||||
process.env.NODE_ENV = 'development'
|
||||
} else {
|
||||
process.env.NODE_ENV = 'production'
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
@@ -196,8 +202,9 @@ if (lastOpenDir) {
|
||||
prepareAndSendDir(lastOpenDir)
|
||||
}
|
||||
|
||||
// Initially setup watcher for 'hello.md'
|
||||
setupWatcher(lastFilePath ?? path.resolve(__dirname, '../../../hello.md'))
|
||||
if (lastFilePath) {
|
||||
setupWatcher(lastFilePath)
|
||||
}
|
||||
|
||||
function getFilesRecursive(
|
||||
directory: string,
|
||||
|
||||
@@ -29,10 +29,11 @@ export const View = ({ setFileName }) => {
|
||||
|
||||
useEffect(() => {
|
||||
const contentListener: IpcRendererListener = (_event, content) => {
|
||||
setCode(content.code)
|
||||
setFileName(content.fileName)
|
||||
setSelectedFile(content.fileName)
|
||||
setToc(content.toc)
|
||||
if (!content) return
|
||||
setCode(content?.code)
|
||||
setFileName(content?.fileName)
|
||||
setSelectedFile(content?.fileName)
|
||||
setToc(content?.toc)
|
||||
}
|
||||
|
||||
const directoryContentsListener: IpcRendererListener = (_event, content) => {
|
||||
|
||||
Reference in New Issue
Block a user