Skip to content

Commit

Permalink
Merge pull request #84 from mountainash/develop
Browse files Browse the repository at this point in the history
Apple Silicon build
  • Loading branch information
mountainash authored Feb 27, 2022
2 parents 27bd3d0 + cbc40aa commit 9eed2fb
Show file tree
Hide file tree
Showing 6 changed files with 640 additions and 4,701 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
"indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"semi": ["error", "always", { "omitLastInOneLineBlock": true }],
"eol-last": ["error", "never"],
"no-trailing-spaces": "error",
"one-var": "warn",
"eqeqeq": ["warn", "smart"],
"default-case-last": "warn",
"no-empty-function": "error",
Expand Down
28 changes: 6 additions & 22 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ ipcRenderer.on('goToNewShows', () => {
webview.location = Endpoints.NEWSHOWS;
});

ipcRenderer.on('logOut', async () => {
ipcRenderer.on('logOut', async() => {
console.log('ipcRenderer: logOut');

keyStore.Logout();
});

Expand All @@ -79,7 +78,7 @@ const NotificationOriginal = Notification;
function NotificationDecorated(title) {
const notification = {
_handleClick: [],
close() {},
close,
addEventListener(type, callback) {
if (type !== 'click') return;

Expand All @@ -90,7 +89,7 @@ function NotificationDecorated(title) {
callback.call(this);
}
}
}
};

ipcRenderer.send('notification', notifications.push(notification) - 1, title);
return notification;
Expand All @@ -110,26 +109,11 @@ Object.defineProperties(NotificationDecorated, {

window.Notification = NotificationDecorated;

const AudioOriginal = Audio;
const beaconNotificationRegex = /beacon-notification\.(?:.*)$/;

function createObserverCallback(tagName, callback) {
return function(records) {
for (const record of records) {
for (const node of record.addedNodes) {
if (node.tagName === tagName) {
callback();
}
}
}
}
}

ipcRenderer.on('notificationClicked', (_, notificationIndex) => {
const originalOpen = window.open;
window.open = (url) => {
window.location = url;
}
};
notifications[notificationIndex].click();
window.open = originalOpen;
});
Expand Down Expand Up @@ -224,7 +208,7 @@ webview.addEventListener('DOMContentLoaded', () => {
// add a listener to the form to capture login details and store them
const loginbutton = loginform.querySelector(DomHooks.loginbutton);

loginbutton.addEventListener('click', async () => {
loginbutton.addEventListener('click', async() => {
let username = loginform.querySelector(DomHooks.usernameinput).value;
let password = loginform.querySelector(DomHooks.passwordinput).value;

Expand All @@ -247,7 +231,7 @@ webview.addEventListener('click', (event) => {
if (playPauseClicked) {
console.log(playPauseClicked);

const paused = playPauseClicked.getAttribute('aria-label') == 'Pause';
const paused = playPauseClicked.getAttribute('aria-label') === 'Pause';
is_playing = !paused;
console.log('Paused', paused);

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const menuTemplate = require('./menu.js');
const menu = Menu.buildFromTemplate(menuTemplate);
const contextMenu = require('electron-context-menu');
const fs = require('fs');
const Config = require('electron-config');
const config = new Config();
const Store = require('electron-store');
const config = new Store();

const BASE_URL = 'https://www.mixcloud.com/';
const DEBUG = process.env.ELECTRON_DEBUG || false;
Expand Down
9 changes: 7 additions & 2 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function sendAction(action) {
const template = [
{
label: appName,
submenu: [{
submenu: [
{
label: `About ${appName}`,
role: 'about'
},
Expand Down Expand Up @@ -70,6 +71,10 @@ const template = [
// click: () => sendAction('goForward')
// },
// { type: 'separator' },
{
label: 'Dashboard',
click: () => sendAction('goToDashboard')
},
{
label: 'New Shows',
click: () => sendAction('goToNewShows')
Expand All @@ -78,7 +83,7 @@ const template = [
},
{
role: 'window',
submenu: [
submenu: [
{ role: 'close' },
{ role: 'minimize' },
{ role: 'zoom' },
Expand Down
Loading

0 comments on commit 9eed2fb

Please sign in to comment.