Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
defaults: {
cwd: undefined,
monaco: {
editorOptions: {
minimap: {
enabled: false
},
lineNumbers: 'off',
wordWrap: 'bounded'
}
},
sorting: {
by: 'title',
type: 'ascending'
},
theme: darkMode.isEnabled ? 'dark' : 'light',
tutorial: false // Did we import the tutorial yet?
}
});
/* EXPORT */
export default Settings;
// @flow
import { combineReducers } from 'redux'
import { darkMode } from 'electron-util'
import Persistor from '../modules/Persistor'
import type { Action } from '../flow'
const init = {
isDark: darkMode.isEnabled,
quitMessage: 'https://github.com/brandly/Lax'
}
function isDark(state: boolean = init.isDark, action: Action): boolean {
switch (action.type) {
case 'TOGGLE_THEME':
return !state
default:
return state
}
}
function quitMessage(state: string = init.quitMessage, action: Action): string {
switch (action.type) {
case 'SET_QUIT_MSG':
return action.message
}
})
app.on('before-quit', () => {
app.isQuiting = true
globalShortcut.unregisterAll()
tray.destroy()
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
if (darkMode.isEnabled) {
if (mainWindow) {
mainWindow.webContents.send('Dark mode', {
darkmode: systemPreferences.isDarkMode()
})
}
}
darkMode.onChange(() => {
if (mainWindow) {
mainWindow.webContents.send('Dark mode', {
darkmode: darkMode.isEnabled
})
}
})
ipcMain.on('article-selected', (event, status) => {
export const state = new Store({
name: 'state',
defaults: {
lastWindowState: {
width: 1024,
height: 768,
x: undefined as number | undefined,
y: undefined as number | undefined
}
}
})
export const settings = new Store({
name: 'settings',
defaults: {
theme: darkMode.isEnabled ? 'dark' : 'light',
locale: api.app.getLocale(),
titleBarStyle: 'custom' as 'custom' | 'native'
}
})
toggle(currentPosition) {
if (searchWindow === null || searchWindow.isDestroyed()) {
searchWindow = makeWindow('search', {
width: 300,
height: 280,
x: currentPosition[0] - 300,
y: currentPosition[1],
backgroundColor: darkMode.isEnabled ? '#393736' : '#F5F5F5'
})
searchWindow.title = 'Search'
} else {
searchWindow.focus()
}
},
next() {
initialState() {
return {isDarkMode: darkMode.isEnabled}
}
get backgroundColor() {
let color
if (this.props.currentProfile) {
color = this.props.currentProfile.get('tabColor')
} else if (darkMode.isEnabled) {
color = '#F5F5F5'
} else {
color = '#424242'
}
return color
}
darkMode.onChange(() => {
if (mainWindow) {
mainWindow.webContents.send('Dark mode', {
darkmode: darkMode.isEnabled
})
}
})
initialState() {
return {
isDarkMode: darkMode.isEnabled,
query: '',
regex: false,
caseSensitive: false,
wholeWord: false
}
}
toggle(currentPosition) {
if (searchWindow === null || searchWindow.isDestroyed()) {
searchWindow = makeWindow('search', {
width: 300,
height: 280,
x: currentPosition[0] - 300,
y: currentPosition[1],
backgroundColor: darkMode.isEnabled ? '#393736' : '#F5F5F5'
})
searchWindow.title = 'Search'
} else {
searchWindow.focus()
}
},
next() {