Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Silicon build #84

Merged
merged 8 commits into from
Feb 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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