|
|
|
@ -28,7 +28,7 @@ class Ation { |
|
|
|
|
|
|
|
|
|
app.whenReady().then(async () => { |
|
|
|
|
if (this.fileToOpen) |
|
|
|
|
this.openFile(this.fileToOpen, true); |
|
|
|
|
this.openFile(this.fileToOpen); |
|
|
|
|
protocol.registerFileProtocol("slideimg", (request, callback) => { |
|
|
|
|
const uri = request.url.replace(/^slideimg:\/\//, ""); |
|
|
|
|
const extension = path.extname(uri).replace(/^\./, ""); |
|
|
|
@ -66,12 +66,17 @@ class Ation { |
|
|
|
|
|
|
|
|
|
if (!change)
|
|
|
|
|
this.currentFile = filePath; |
|
|
|
|
|
|
|
|
|
this.watcher = fsn.watch(filePath, () => { |
|
|
|
|
if (this.watcher) |
|
|
|
|
this.watcher.close(); |
|
|
|
|
this.watcher = fsn.watch(filePath, (eventType, path) => { |
|
|
|
|
if (path.match(/~$/)) // handling unix swap files here
|
|
|
|
|
setTimeout(() => this.openFile(this.currentFile, true), 1000); |
|
|
|
|
else |
|
|
|
|
this.openFile(this.currentFile, true); |
|
|
|
|
}); |
|
|
|
|
this.windowManager.mainWindow.send("Ation::openFile", [basePath, data]); |
|
|
|
|
} catch { |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log(error); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|