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

fix: start on login #1334

Merged
merged 1 commit into from
Apr 17, 2020
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"clean:webui": "shx rm -rf assets/webui/",
"build": "run-s clean:webui build:*",
"build:webui": "run-s build:webui:*",
"build:webui:download": "npx ipfs-or-gateway -c Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip -p assets/webui/ -t 360000 --verbose",
"build:webui:download": "npx ipfs-or-gateway -c bafybeidatpz2hli6fgu3zul5woi27ujesdf5o5a7bu622qj6ugharciwjq -p assets/webui/ -t 360000 --verbose",
"build:webui:minimize": "shx rm -rf assets/webui/static/js/*.map && shx rm -rf assets/webui/static/css/*.map",
"build:binaries": "electron-builder --publish onTag"
},
Expand Down
2 changes: 2 additions & 0 deletions src/create-toggler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { ipcMain } = require('electron')
const os = require('os')
const store = require('./common/store')
const logger = require('./common/logger')

Expand All @@ -23,6 +24,7 @@ module.exports = function ({ webui }, settingsOption, activate) {
webui.webContents.send('config.changed', {
config: store.store,
changed: settingsOption,
platform: os.platform(),
success
})
})
Expand Down
6 changes: 5 additions & 1 deletion src/webui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { screen, BrowserWindow, ipcMain, app, session } = require('electron')
const { join } = require('path')
const { URL } = require('url')
const serve = require('electron-serve')
const os = require('os')
const openExternal = require('./open-external')
const logger = require('../common/logger')
const store = require('../common/store')
Expand Down Expand Up @@ -101,7 +102,10 @@ module.exports = async function (ctx) {
})

ipcMain.on('config.get', () => {
window.webContents.send('config.changed', { config: store.store })
window.webContents.send('config.changed', {
platform: os.platform(),
config: store.store
})
})

session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
Expand Down
5 changes: 5 additions & 0 deletions test/unit/create-toggler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const sinon = require('sinon')
const chai = require('chai')
const { expect } = chai
const os = require('os')
const dirtyChai = require('dirty-chai')
const mockElectron = require('./mocks/electron')
const mockStore = require('./mocks/store')
Expand Down Expand Up @@ -43,6 +44,7 @@ describe('Create toggler', () => {
expect(args[0]).to.equal('config.changed')
expect(args[1]).to.deep.equal({
changed: 'OPT',
platform: os.platform(),
config: {
OPT: true
},
Expand All @@ -68,6 +70,7 @@ describe('Create toggler', () => {
expect(args[0]).to.equal('config.changed')
expect(args[1]).to.deep.equal({
changed: 'OPT',
platform: os.platform(),
config: {},
success: false
})
Expand All @@ -93,6 +96,7 @@ describe('Create toggler', () => {
expect(args[0]).to.equal('config.changed')
expect(args[1]).to.deep.equal({
changed: 'OPT',
platform: os.platform(),
config: {
OPT: false
},
Expand Down Expand Up @@ -120,6 +124,7 @@ describe('Create toggler', () => {
expect(args[0]).to.equal('config.changed')
expect(args[1]).to.deep.equal({
changed: 'OPT',
platform: os.platform(),
config: {
OPT: true
},
Expand Down