Merge branch 'master' into fix-typos
This commit is contained in:
1
src/.storybook/addons.js
Normal file
1
src/.storybook/addons.js
Normal file
@@ -0,0 +1 @@
|
||||
import '@storybook/addon-actions/register';
|
@@ -1,7 +1,18 @@
|
||||
const path = require("path");
|
||||
|
||||
const rendererConfig = require('../../webpack.config.renderer');
|
||||
|
||||
// https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode--default
|
||||
module.exports = (baseConfig, env, defaultConfig) => {
|
||||
defaultConfig.resolve.modules = [path.resolve(__dirname, '../node_modules'), 'node_modules'];
|
||||
return defaultConfig;
|
||||
module.exports = (storybookBaseConfig, configType) => {
|
||||
// Avoid conflicting two instances of React due to two package.json structure
|
||||
storybookBaseConfig.resolve.modules.unshift(path.resolve(__dirname, '../node_modules'));
|
||||
|
||||
// Use same rules
|
||||
storybookBaseConfig.module.rules = rendererConfig.module.rules.concat({
|
||||
test: /\.(ttf|woff2?|eot|svg)/,
|
||||
use: {
|
||||
loader: 'file-loader'
|
||||
}
|
||||
});
|
||||
return storybookBaseConfig;
|
||||
}
|
||||
|
15
src/main.js
15
src/main.js
@@ -177,13 +177,18 @@ const trayImages = (() => {
|
||||
})();
|
||||
|
||||
// If there is already an instance, activate the window in the existing instance and quit this one
|
||||
if (app.makeSingleInstance((commandLine/*, workingDirectory*/) => {
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) {
|
||||
app.exit();
|
||||
global.willAppQuit = true;
|
||||
}
|
||||
app.on('second-instance', (event, secondArgv) => {
|
||||
// Protocol handler for win32
|
||||
// argv: An array of the second instance’s (command line / deep linked) arguments
|
||||
if (process.platform === 'win32') {
|
||||
// Keep only command line / deep linked arguments
|
||||
if (Array.isArray(commandLine.slice(1)) && commandLine.slice(1).length > 0) {
|
||||
setDeeplinkingUrl(commandLine.slice(1)[0]);
|
||||
if (Array.isArray(secondArgv.slice(1)) && secondArgv.slice(1).length > 0) {
|
||||
setDeeplinkingUrl(secondArgv.slice(1)[0]);
|
||||
mainWindow.webContents.send('protocol-deeplink', deeplinkingUrl);
|
||||
}
|
||||
}
|
||||
@@ -196,9 +201,7 @@ if (app.makeSingleInstance((commandLine/*, workingDirectory*/) => {
|
||||
mainWindow.show();
|
||||
}
|
||||
}
|
||||
})) {
|
||||
app.exit();
|
||||
}
|
||||
});
|
||||
|
||||
function shouldShowTrayIcon() {
|
||||
if (process.platform === 'win32') {
|
||||
|
Reference in New Issue
Block a user