Skip to content

Commit c44e194

Browse files
committed
cleaned up code according to @murilopolese 's review
1 parent 42fe6ae commit c44e194

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

index.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const { app, BrowserWindow, Menu, ipcMain, dialog } = require('electron')
22
const path = require('path')
3-
const fs = require('fs');
4-
const { info } = require('console');
5-
const join = require('path').join;
6-
const openAboutWindow = require('about-window').default;
3+
const fs = require('fs')
4+
const { info } = require('console')
5+
const join = require('path').join
6+
const openAboutWindow = require('about-window').default
77

88
let win = null // main window
99

@@ -223,17 +223,16 @@ const template = [
223223
]
224224
function normalizeParam(info_or_img_path) {
225225
if (!info_or_img_path) {
226-
throw new Error('First parameter of openAboutWindow() must not be empty. Please see the document: https://github.com/rhysd/electron-about-window/blob/master/README.md');
226+
throw new Error('First parameter of openAboutWindow() must not be empty. Please see the document: https://github.com/rhysd/electron-about-window/blob/master/README.md')
227227
}
228228
if (typeof info_or_img_path === 'string') {
229-
return { icon_path: info_or_img_path };
229+
return { icon_path: info_or_img_path }
230230
}
231231
else {
232-
const info = info_or_img_path;
233232
if (!info.icon_path) {
234-
throw new Error("First parameter of openAboutWindow() must have key 'icon_path'. Please see the document: https://github.com/rhysd/electron-about-window/blob/master/README.md");
233+
throw new Error("First parameter of openAboutWindow() must have key 'icon_path'. Please see the document: https://github.com/rhysd/electron-about-window/blob/master/README.md")
235234
}
236-
return Object.assign({}, info);
235+
return Object.assign({}, info)
237236
}
238237
}
239238

@@ -248,7 +247,7 @@ app.setAboutPanelOptions({
248247
authors: ['Arduino'],
249248
website: 'https://arduino.cc',
250249
iconPath: path.join(__dirname, '../assets/image.png'),
251-
});
250+
})
252251

253252
Menu.setApplicationMenu(menu)
254253

ui/arduino/about.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,5 @@ <h3 class="description"></h3>
1717
<footer class="footer">
1818
<div class="link bug-report-link"></div>
1919
</footer>
20-
21-
<script>var exports = exports || {};</script>
22-
23-
2420
</body>
2521
</html>

0 commit comments

Comments
 (0)