Skip to content

Commit 5e383d4

Browse files
Gianmarco SpinaciGianmarco Spinaci
authored andcommitted
Fix #49.
Now figure blocks are added inside the article structure.
1 parent 100b6c4 commit 5e383d4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/js/raje-core/init.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ if (hasBackend) {
428428
return ipcRenderer.sendSync('selectImageSync')
429429
}
430430

431-
432-
433431
/**
434432
* Send a message to the backend, notify the structural change
435433
*

app/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,11 @@ ipcMain.on('selectImageSync', (event, arg) => {
459459
})
460460

461461
try {
462-
RAJE_FS.saveImageTemp(imagePath[0], (err, result) => {
462+
463+
if (typeof imagePath == 'undefined')
464+
throw new Error()
465+
466+
RAJE_FS.saveImageTemp(imagePath[0], global.articleSettings.savePath, (err, result) => {
463467

464468
if (err) return event.returnValue = err
465469

app/modules/raje_fs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ module.exports = {
182182
/**
183183
* Save the image in the temporary folder OR in the assets folder
184184
*/
185-
saveImageTemp: function (path, image, callback) {
185+
saveImageTemp: function (image, path, callback) {
186186

187187
// The folder where images have to be stored
188-
let destinationPath = (global.isWrapper) ? global.IMAGE_TEMP : `${path}/img`
188+
let destinationPath = (global.articleSettings.isWrapper) ? global.IMAGE_TEMP : `${path}img`
189189

190190
// If the directory doesn't exist, create it
191191
if (!fs.existsSync(destinationPath))

0 commit comments

Comments
 (0)