Skip to content

Commit 5285680

Browse files
committed
xo lint --fix
1 parent 17e6319 commit 5285680

File tree

1 file changed

+49
-47
lines changed
  • plugins/taskbar-mediacontrol

1 file changed

+49
-47
lines changed

plugins/taskbar-mediacontrol/back.js

+49-47
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
1-
const getSongControls = require("../../providers/song-controls");
2-
const getSongInfo = require("../../providers/song-info");
1+
const getSongControls = require('../../providers/song-controls');
2+
const getSongInfo = require('../../providers/song-info');
33
const path = require('path');
44

55
module.exports = win => {
6-
win.hide = function () {
7-
win.minimize()
8-
win.setSkipTaskbar(true);}
6+
win.hide = function () {
7+
win.minimize();
8+
win.setSkipTaskbar(true);
9+
};
910

10-
var show = win.show;
11-
win.show = function () {
12-
win.restore();
13-
win.focus();
14-
win.setSkipTaskbar(false);
15-
show.apply(win)
16-
}
11+
const {show} = win;
12+
win.show = function () {
13+
win.restore();
14+
win.focus();
15+
win.setSkipTaskbar(false);
16+
show.apply(win);
17+
};
1718

18-
win.isVisible = function () {
19-
return !win.isMinimized();
20-
}
19+
win.isVisible = function () {
20+
return !win.isMinimized();
21+
};
2122

22-
const registerCallback = getSongInfo(win);
23-
const { playPause, next, previous} = getSongControls(win);
23+
const registerCallback = getSongInfo(win);
24+
const {playPause, next, previous} = getSongControls(win);
2425

25-
// If the page is ready, register the callback
26-
win.on("ready-to-show", () => {
27-
registerCallback((songInfo) => {
28-
//wait for song to start before setting thumbar
29-
if(songInfo.title === '') {
30-
return;
31-
}
32-
// win32 require full rewrite of components
33-
win.setThumbarButtons([
34-
{
35-
tooltip: 'Previous',
36-
icon: get('backward.png'),
37-
click () { previous(win.webContents) }
38-
}, {
39-
tooltip: 'Play/Pause',
40-
//update icon based on play state
41-
icon: songInfo.isPaused ? get('play.png') : get('pause.png'),
42-
click () { playPause(win.webContents) }
43-
} , {
44-
tooltip: 'Next',
45-
icon: get('forward.png'),
46-
click () { next(win.webContents) }
47-
}
48-
])
49-
});
50-
});
26+
// If the page is ready, register the callback
27+
win.on('ready-to-show', () => {
28+
registerCallback(songInfo => {
29+
// Wait for song to start before setting thumbar
30+
if (songInfo.title === '') {
31+
return;
32+
}
33+
34+
// Win32 require full rewrite of components
35+
win.setThumbarButtons([
36+
{
37+
tooltip: 'Previous',
38+
icon: get('backward.png'),
39+
click() {previous(win.webContents);}
40+
}, {
41+
tooltip: 'Play/Pause',
42+
// Update icon based on play state
43+
icon: songInfo.isPaused ? get('play.png') : get('pause.png'),
44+
click() {playPause(win.webContents);}
45+
}, {
46+
tooltip: 'Next',
47+
icon: get('forward.png'),
48+
click() {next(win.webContents);}
49+
}
50+
]);
51+
});
52+
});
5153
};
5254

53-
//util
54-
function get (address) {
55-
return path.join(__dirname,address);
56-
}
55+
// Util
56+
function get(address) {
57+
return path.join(__dirname, address);
58+
}

0 commit comments

Comments
 (0)