Skip to content

Commit 6634d94

Browse files
authoredAug 1, 2020
Merge pull request #7 from arturock/dependencies
Update dependencies
2 parents ef32865 + 809b716 commit 6634d94

File tree

5 files changed

+1505
-893
lines changed

5 files changed

+1505
-893
lines changed
 

‎app/app.js

+33-30
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const settings = require('electron-settings');
1111
const menus = require('./menus');
1212

1313
const ELECTRON_VERSION = process.versions.electron;
14-
const APP_NAME = app.getName();
14+
const APP_NAME = app.name;
1515
const APP_VERSION = app.getVersion();
1616
const APP_DESCRIPTION = 'Unofficial Basecamp GNU/Linux Desktop Client.';
1717
const BASECAMP_URL = 'https://launchpad.37signals.com';
@@ -30,24 +30,25 @@ let unreadsNotified = false;
3030
*/
3131
const basecamp = {
3232
buildApp(url) {
33-
basecamp.createWindow(url);
34-
basecamp.addAppMenu();
35-
basecamp.addContextMenu();
36-
basecamp.addTrayIcon();
37-
basecamp.setIcons();
33+
this.createWindow(url);
34+
this.addAppMenu();
35+
this.addContextMenu();
36+
this.addTrayIcon();
37+
this.setIcons();
38+
this.addWindowEvents();
3839
},
3940

4041
/**
4142
* Creates the app window.
4243
*/
4344
createWindow(url) {
4445
win = new BrowserWindow({
45-
y: settings.get('posY', 0),
46-
x: settings.get('posX', 0),
47-
width: settings.get('width', 770),
48-
height: settings.get('height', 700),
46+
y: settings.getSync('posY', 0),
47+
x: settings.getSync('posX', 0),
48+
width: settings.getSync('width', 770),
49+
height: settings.getSync('height', 700),
4950
title: APP_NAME,
50-
icon: basecamp.getIcon('icon'),
51+
icon: this.getIcon('icon'),
5152
autoHideMenuBar: true,
5253
backgroundColor: '#f5efe6',
5354
webPreferences: {
@@ -56,28 +57,30 @@ const basecamp = {
5657
},
5758
});
5859

59-
if (settings.get('isMaximized', false)) {
60+
if (settings.getSync('isMaximized', false)) {
6061
win.maximize();
6162
}
6263

6364
win.loadURL(url);
65+
},
6466

67+
addWindowEvents() {
6568
win
6669
.on('close', () => {
6770
const bounds = win.getBounds();
68-
settings.set('posX', bounds.x);
69-
settings.set('posY', bounds.y);
70-
settings.set('width', bounds.width);
71-
settings.set('height', bounds.height);
72-
settings.set('isMaximized', win.isMaximized());
71+
settings.setSync('posX', bounds.x);
72+
settings.setSync('posY', bounds.y);
73+
settings.setSync('width', bounds.width);
74+
settings.setSync('height', bounds.height);
75+
settings.setSync('isMaximized', win.isMaximized());
7376
})
7477
.on('closed', () => {
7578
tray = null;
7679
win = null;
7780
})
7881
.on('page-title-updated', (event, title) => {
7982
event.preventDefault();
80-
basecamp.setTitles(title);
83+
this.setTitles(title);
8184
});
8285

8386
win.webContents
@@ -126,7 +129,7 @@ const basecamp = {
126129
* Adds the tray icon.
127130
*/
128131
addTrayIcon() {
129-
tray = new Tray(basecamp.getIcon('tray'));
132+
tray = new Tray(this.getIcon('tray'));
130133
tray.setToolTip(APP_NAME);
131134
tray.setContextMenu(menus.forTray());
132135
tray.on('click', () => {
@@ -150,7 +153,7 @@ const basecamp = {
150153
message: 'This will clear all data.\n\nDo you want to proceed?',
151154
}, (response) => {
152155
if (response === 0) {
153-
basecamp.clearData();
156+
this.clearData();
154157
}
155158
});
156159
},
@@ -161,7 +164,7 @@ const basecamp = {
161164
showAboutDialog() {
162165
dialog.showMessageBox(win, {
163166
type: 'info',
164-
icon: basecamp.getIcon('logo'),
167+
icon: this.getIcon('logo'),
165168
buttons: ['Ok'],
166169
defaultId: 0,
167170
title: 'About',
@@ -207,13 +210,13 @@ const basecamp = {
207210
unreadsNotified = true;
208211
}
209212

210-
if (settings.get('showBadge', DEFAULTS.showBadge)) {
211-
basecamp.setIcons(`-unreads-${(unreads > 10 ? '10p' : unreads)}`);
213+
if (settings.getSync('showBadge', DEFAULTS.showBadge)) {
214+
this.setIcons(`-unreads-${(unreads > 10 ? '10p' : unreads)}`);
212215
} else {
213-
basecamp.setIcons('-unreads');
216+
this.setIcons('-unreads');
214217
}
215218
} else {
216-
basecamp.setIcons();
219+
this.setIcons();
217220
}
218221
});
219222
},
@@ -222,8 +225,8 @@ const basecamp = {
222225
* Sets the app & tray icons.
223226
*/
224227
setIcons(suffix) {
225-
win.setIcon(basecamp.getIcon(`icon${suffix ? '-unreads' : ''}`));
226-
tray.setImage(basecamp.getIcon(`tray${suffix || ''}`));
228+
win.setIcon(this.getIcon(`icon${suffix ? '-unreads' : ''}`));
229+
tray.setImage(this.getIcon(`tray${suffix || ''}`));
227230
},
228231

229232
/**
@@ -234,7 +237,7 @@ const basecamp = {
234237
* @return {string}
235238
*/
236239
getIcon(icon) {
237-
const iconScheme = settings.get('iconScheme', DEFAULTS.iconScheme);
240+
const iconScheme = settings.getSync('iconScheme') || DEFAULTS.iconScheme;
238241
return `${ICONS_PATH}/${iconScheme}/${icon}.png`;
239242
},
240243

@@ -256,7 +259,7 @@ const basecamp = {
256259
* @param {string} color
257260
*/
258261
configureIconScheme(color) {
259-
settings.set('iconScheme', color);
262+
settings.setSync('iconScheme', color);
260263
win.reload();
261264
},
262265

@@ -266,7 +269,7 @@ const basecamp = {
266269
* @param {string} color
267270
*/
268271
configureShowBadge(config) {
269-
settings.set('showBadge', config);
272+
settings.setSync('showBadge', config);
270273
win.reload();
271274
},
272275
};

‎app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"productName": "Basecamp for Linux",
44
"baseName": "basecamp",
55
"description": "Unofficial Basecamp GNU/Linux Desktop Client.",
6-
"version": "0.1.2",
6+
"version": "0.1.3",
77
"author": "Arturo Rodríguez",
88
"license": "MIT",
99
"main": "app.js",
@@ -21,6 +21,6 @@
2121
"Desktop"
2222
],
2323
"dependencies": {
24-
"electron-settings": "^3.2.0"
24+
"electron-settings": "^4.0.2"
2525
}
2626
}

‎package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"license": "MIT",
33
"private": true,
44
"config": {
5-
"current_version": "0.1.2"
5+
"current_version": "0.1.3"
66
},
77
"devDependencies": {
88
"basecamp-linux": "file:app",
9-
"electron": "^1.8.7",
10-
"electron-packager": "11.2.0",
11-
"eslint": "^4.19.1",
12-
"eslint-config-airbnb-base": "^13.0.0",
13-
"eslint-plugin-import": "^2.13.0",
14-
"lzma-native": "^3.0.8",
15-
"minimist": "^1.2.0",
16-
"tar": "^4.4.4"
9+
"electron": "8.4.1",
10+
"electron-packager": "11.2.1",
11+
"eslint": "^7.5.0",
12+
"eslint-config-airbnb-base": "^14.2.0",
13+
"eslint-plugin-import": "^2.22.0",
14+
"lzma-native": "^6.0.1",
15+
"minimist": "^1.2.5",
16+
"tar": "^6.0.2"
1717
},
1818
"scripts": {
1919
"test": "echo \"Error: no test specified\" && exit 1",

‎scripts/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const builder = {
6666

6767
const arch = { arch: ARGS.arch.split(',') };
6868

69-
packager(Object.assign({}, PACKAGE_CONFIG, arch))
69+
packager({ ...PACKAGE_CONFIG, ...arch })
7070
.then((appPaths) => {
7171
appPaths.forEach((appPath) => {
7272
if (ARGS.compress) {

‎yarn.lock

+1,460-851
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.