Skip to content

Commit

Permalink
Fixed bug in file saving
Browse files Browse the repository at this point in the history
  • Loading branch information
yrahul3910 committed Jan 4, 2019
1 parent e9d518b commit 3ae6fd6
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 820 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ <h1>Could not perform action</h1>
<div data-role="dialog" id="aboutDialog" class="padding20 dialog" data-close-button="true" data-overlay="true"
data-overlay-color="#1d1d1d" data-overlay-click-close="true" style="visibility: hidden;">
<h2>About</h2>
<p><b>JournalBear 5.0</b><br />
<p><b>JournalBear 5.1</b><br />
By <b>Rahul Yedida</b></p>
<p>JournalBear is a free and open source software. None of your data is collected. If you like the software,
consider spreading the word to support it.</p>
Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let win;
function createWindow() {
// Create the browser window.
win = new BrowserWindow({ width: 800, height: 660, frame: false, icon: __dirname + "/../build/logo.png" });
win.webContents.openDevTools();
//win.webContents.openDevTools();
// and load the index.html of the app.
win.loadURL(url.format({
pathname: path.join(__dirname, "index.html"),
Expand Down
7 changes: 4 additions & 3 deletions app/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,9 @@ $("#save").click(() => {
journalEntries.version = VERSION_NUMBER;
let journalDir = os.tmpdir() + "/_jbfiles";
if (fs.existsSync(journalDir))
rimraf.sync(journalDir);
fs.mkdirSync(journalDir);
fse.removeSync(journalDir + "/data.json");
else
fs.mkdirSync(journalDir);

async.waterfall([
(callback) => {
Expand All @@ -417,7 +418,7 @@ $("#save").click(() => {
},
(callback) => {
// Add the images now
if (fs.existsSync(os.tmpdir() + "/_jbimages"))
if (fs.existsSync(os.tmpdir() + "/_jbimages"))
fse.copy(os.tmpdir() + "/_jbimages", journalDir + "/images", callback);
else
callback(null);
Expand Down
Loading

0 comments on commit 3ae6fd6

Please sign in to comment.