Skip to content

Commit 725978e

Browse files
committed
Fix issue where application protocol was not correctly registered in release build
1 parent 9b38a8c commit 725978e

File tree

6 files changed

+30
-19
lines changed

6 files changed

+30
-19
lines changed

presenter-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plodo",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"description": "Use plodo to get immediate feedback from your audience while you present",
55
"author": "Lars Baunwall <larslb@plodo.io> (https://www.plodo.io/)",
66
"homepage": "https://www.plodo.io",

presenter-app/src/background.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ import celebrationWindow from "./windows/CelebrationWindow";
1414

1515
const DEBUG = process.env.NODE_ENV !== "production";
1616

17-
autoUpdater.logger = logging.log;
17+
autoUpdater.logger = logging.logger;
1818
autoUpdater.logger.transports.file.level = "info";
1919

2020
// Don't show the app in dock
21-
if (process.platform === "darwin")
22-
app.dock.hide();
21+
if (process.platform === "darwin") app.dock.hide();
2322

2423
// Scheme must be registered before the app is ready
2524
protocol.registerSchemesAsPrivileged([
@@ -58,7 +57,7 @@ app.on("ready", async () => {
5857
console.error("Vue Devtools failed to install:", e.toString());
5958
}
6059
}
61-
60+
6261
ApiService.init();
6362
logging.init();
6463
UIService.init();
@@ -69,7 +68,7 @@ app.on("ready", async () => {
6968
mainWindow.openAndNavigate();
7069
tray.createTray();
7170
}, 500);
72-
71+
7372
if (store.getters.celebrate)
7473
setTimeout(() => {
7574
celebrationWindow.OpenWindow(screen.getPrimaryDisplay());

presenter-app/src/common/Logging.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
import log from "electron-log";
2-
console.log = log.log;
1+
import electronLog from "electron-log";
2+
console.log = electronLog.log;
33

44
const DEBUG = process.env.NODE_ENV !== "production";
55

66
const init = () => {
77
if(DEBUG){
8-
log.transports.file.level = "silly";
8+
electronLog.transports.file.level = "silly";
99
} else {
10-
log.transports.file.level = "warn";
10+
electronLog.transports.file.level = "warn";
1111
}
1212

1313
process.on("uncaughtException", (err, origin) => {
14-
log.error(`Caught exception: ${err}, origin: ${origin}`);
14+
electronLog.error(`Caught exception: ${err}, origin: ${origin}`);
1515
});
1616
};
1717

18-
export default { init, log };
18+
const log = electronLog.log;
19+
const logger = electronLog;
20+
21+
export default { init, log, logger };

presenter-app/src/windows/MainAppWindow.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"use strict";
22
/* global __static */
3-
import { app, BrowserWindow, screen, Menu } from "electron";
3+
import { BrowserWindow, screen } from "electron";
44
import path from "path";
55
import ensurePlodoProtocol from "./windowHelper";
6+
import logging from "../common/Logging";
67
import tray from "./Tray";
78

89
const DEBUG = process.env.NODE_ENV !== "production";
910
let win;
1011
const isMac = process.platform === "darwin";
1112

12-
1313
/**
1414
* @param {String} route
1515
*/
@@ -41,7 +41,6 @@ const showWindow = () => {
4141
}
4242
};
4343

44-
4544
/**
4645
* @param {BrowserWindow} win
4746
* @returns {{x:Number, y:Number}}
@@ -100,7 +99,7 @@ const createWindow = (hideOnBlur = false, hideOnClose = true) => {
10099
});
101100
};
102101

103-
const navigate = (window, route) => {
102+
const navigate = (window, route = "") => {
104103
if (process.env.WEBPACK_DEV_SERVER_URL) {
105104
// Load the url of the dev server if in development mode
106105
window.loadURL(`${process.env.WEBPACK_DEV_SERVER_URL}${route}`);
@@ -111,6 +110,8 @@ const navigate = (window, route) => {
111110
}
112111
};
113112

114-
const destroy = () => {if (win) win.destroy();};
113+
const destroy = () => {
114+
if (win) win.destroy();
115+
};
115116

116117
export default { openAndNavigate, toggleWindow, getWindow, destroy };
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { app } from "electron";
1+
import {createProtocol} from "vue-cli-plugin-electron-builder/lib";
2+
let protocolCreated = false;
23

34
export default () => {
4-
if (!app.isDefaultProtocolClient("plodo")) app.setAsDefaultProtocolClient("plodo");
5+
if(!protocolCreated)
6+
createProtocol("plodo");
7+
8+
protocolCreated = true;
59
};

presenter-app/vue.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ module.exports = {
1717
publish: IS_LOCAL_DEV
1818
? []
1919
: ["github"],
20+
protocols: [{
21+
name: "plodo",
22+
schemes: ["plodo"]
23+
}],
2024
win: {
2125
appId: "io.plodo.presenter",
2226
certificateSubjectName:

0 commit comments

Comments
 (0)