mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-06 12:25:22 +01:00
Update electron version to 6.1.0
This commit is contained in:
parent
0fce3355a2
commit
e1cbdedaf5
12
package-lock.json
generated
12
package-lock.json
generated
@ -7426,9 +7426,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"electron": {
|
"electron": {
|
||||||
"version": "5.0.11",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-5.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-6.1.0.tgz",
|
||||||
"integrity": "sha512-2QVVycTmvMmKC3S9XV7zSvouYBooHRTOBx1r64nBwtMh44gPydR3HzUbyVYjjxsw+4vIuH6AqNuY48KtWRpajg==",
|
"integrity": "sha512-CGdM6671gA0WUmsQCVO3stqpvm6/x+S+MkKlqgsk2N3GXnIa3KkfR8k4YNp8gnCgLSZQ0yucFQB/DyEYSjrzrA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "^10.12.18",
|
"@types/node": "^10.12.18",
|
||||||
@ -7437,9 +7437,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.14.21",
|
"version": "10.14.22",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.21.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz",
|
||||||
"integrity": "sha512-nuFlRdBiqbF+PJIEVxm2jLFcQWN7q7iWEJGsBV4n7v1dbI9qXB8im2pMMKMCUZe092sQb5SQft2DHfuQGK5hqQ==",
|
"integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"build:linux": "npm run build && npm run package:linux",
|
"build:linux": "npm run build && npm run package:linux",
|
||||||
"build:win32": "npm run build && npm run package:win32",
|
"build:win32": "npm run build && npm run package:win32",
|
||||||
"build:win64": "npm run build && npm run package:win64",
|
"build:win64": "npm run build && npm run package:win64",
|
||||||
"build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=5.0.11 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
|
"build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=6.1.0 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
|
||||||
"package:mac": "electron-builder --mac --x64",
|
"package:mac": "electron-builder --mac --x64",
|
||||||
"package:linux": "electron-builder --linux",
|
"package:linux": "electron-builder --linux",
|
||||||
"package:win32": "electron-builder --win --ia32",
|
"package:win32": "electron-builder --win --ia32",
|
||||||
@ -238,7 +238,7 @@
|
|||||||
"css-loader": "^3.0.0",
|
"css-loader": "^3.0.0",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"devtron": "^1.4.0",
|
"devtron": "^1.4.0",
|
||||||
"electron": "5.0.11",
|
"electron": "6.1.0",
|
||||||
"electron-builder": "^21.2.0",
|
"electron-builder": "^21.2.0",
|
||||||
"electron-debug": "^2.2.0",
|
"electron-debug": "^2.2.0",
|
||||||
"electron-devtools-installer": "^2.2.4",
|
"electron-devtools-installer": "^2.2.4",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Event } from 'electron'
|
import { IpcMainEvent } from 'electron'
|
||||||
import { createLocalVue } from '@vue/test-utils'
|
import { createLocalVue } from '@vue/test-utils'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import Theme from '~/src/constants/theme'
|
import Theme from '~/src/constants/theme'
|
||||||
@ -53,14 +53,14 @@ describe('Preferences/Appearance', () => {
|
|||||||
App: App
|
App: App
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
ipcMain.once('update-preferences', (event: Event, config: any) => {
|
ipcMain.once('update-preferences', (event: IpcMainEvent, config: any) => {
|
||||||
event.sender.send('response-update-preferences', config)
|
event.sender.send('response-update-preferences', config)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('load', () => {
|
describe('load', () => {
|
||||||
it('loadAppearance', async () => {
|
it('loadAppearance', async () => {
|
||||||
ipcMain.once('get-preferences', (event: Event, _) => {
|
ipcMain.once('get-preferences', (event: IpcMainEvent, _) => {
|
||||||
event.sender.send('response-get-preferences', {
|
event.sender.send('response-get-preferences', {
|
||||||
appearance: {
|
appearance: {
|
||||||
theme: Theme.Dark.key,
|
theme: Theme.Dark.key,
|
||||||
@ -73,7 +73,7 @@ describe('Preferences/Appearance', () => {
|
|||||||
expect(store.state.Preferences.appearance.fontSize).toEqual(15)
|
expect(store.state.Preferences.appearance.fontSize).toEqual(15)
|
||||||
})
|
})
|
||||||
it('loadFonts', async () => {
|
it('loadFonts', async () => {
|
||||||
ipcMain.once('list-fonts', (event: Event, _) => {
|
ipcMain.once('list-fonts', (event: IpcMainEvent, _) => {
|
||||||
event.sender.send('response-list-fonts', ['my-font'])
|
event.sender.send('response-list-fonts', ['my-font'])
|
||||||
})
|
})
|
||||||
await store.dispatch('Preferences/loadFonts')
|
await store.dispatch('Preferences/loadFonts')
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Event } from 'electron'
|
import { IpcMainEvent } from 'electron'
|
||||||
import { createLocalVue } from '@vue/test-utils'
|
import { createLocalVue } from '@vue/test-utils'
|
||||||
import { ipcMain } from '~/spec/mock/electron'
|
import { ipcMain } from '~/spec/mock/electron'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
@ -46,7 +46,7 @@ describe('Hashtag/List', () => {
|
|||||||
|
|
||||||
describe('listTags', () => {
|
describe('listTags', () => {
|
||||||
it('should be updated', async () => {
|
it('should be updated', async () => {
|
||||||
ipcMain.once('list-hashtags', (event: Event) => {
|
ipcMain.once('list-hashtags', (event: IpcMainEvent) => {
|
||||||
event.sender.send('response-list-hashtags', [tag1, tag2])
|
event.sender.send('response-list-hashtags', [tag1, tag2])
|
||||||
})
|
})
|
||||||
await store.dispatch('List/listTags')
|
await store.dispatch('List/listTags')
|
||||||
@ -57,7 +57,7 @@ describe('Hashtag/List', () => {
|
|||||||
describe('removeTag', () => {
|
describe('removeTag', () => {
|
||||||
it('should be updated', async () => {
|
it('should be updated', async () => {
|
||||||
ipcMain.once('remove-hashtag', async () => {
|
ipcMain.once('remove-hashtag', async () => {
|
||||||
ipcMain.once('remove-hashtag', (event: Event, tag: LocalTag) => {
|
ipcMain.once('remove-hashtag', (event: IpcMainEvent, tag: LocalTag) => {
|
||||||
expect(tag).toEqual(tag1)
|
expect(tag).toEqual(tag1)
|
||||||
event.sender.send('response-remove-hashtag')
|
event.sender.send('response-remove-hashtag')
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
BrowserWindowConstructorOptions,
|
BrowserWindowConstructorOptions,
|
||||||
MenuItemConstructorOptions,
|
MenuItemConstructorOptions,
|
||||||
Event,
|
IpcMainEvent,
|
||||||
Notification,
|
Notification,
|
||||||
NotificationConstructorOptions
|
NotificationConstructorOptions
|
||||||
} from 'electron'
|
} from 'electron'
|
||||||
@ -231,7 +231,7 @@ async function createWindow() {
|
|||||||
/**
|
/**
|
||||||
* Enable accessibility
|
* Enable accessibility
|
||||||
*/
|
*/
|
||||||
app.setAccessibilitySupportEnabled(true)
|
app.accessibilitySupportEnabled = true
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial window options
|
* Initial window options
|
||||||
@ -336,7 +336,7 @@ app.on('activate', () => {
|
|||||||
|
|
||||||
let auth = new Authentication(accountManager)
|
let auth = new Authentication(accountManager)
|
||||||
|
|
||||||
ipcMain.on('get-auth-url', (event: Event, domain: string) => {
|
ipcMain.on('get-auth-url', (event: IpcMainEvent, domain: string) => {
|
||||||
auth
|
auth
|
||||||
.getAuthorizationUrl(domain)
|
.getAuthorizationUrl(domain)
|
||||||
.then(url => {
|
.then(url => {
|
||||||
@ -351,7 +351,7 @@ ipcMain.on('get-auth-url', (event: Event, domain: string) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-access-token', (event: Event, code: string) => {
|
ipcMain.on('get-access-token', (event: IpcMainEvent, code: string) => {
|
||||||
auth
|
auth
|
||||||
.getAccessToken(code)
|
.getAccessToken(code)
|
||||||
.then(token => {
|
.then(token => {
|
||||||
@ -373,7 +373,7 @@ ipcMain.on('get-access-token', (event: Event, code: string) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// environments
|
// environments
|
||||||
ipcMain.on('get-social-token', (event: Event) => {
|
ipcMain.on('get-social-token', (event: IpcMainEvent) => {
|
||||||
const token = process.env.SOCIAL_TOKEN
|
const token = process.env.SOCIAL_TOKEN
|
||||||
if (isEmpty(token)) {
|
if (isEmpty(token)) {
|
||||||
return event.sender.send('error-get-social-token', new EmptyTokenError())
|
return event.sender.send('error-get-social-token', new EmptyTokenError())
|
||||||
@ -382,7 +382,7 @@ ipcMain.on('get-social-token', (event: Event) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// nedb
|
// nedb
|
||||||
ipcMain.on('list-accounts', (event: Event) => {
|
ipcMain.on('list-accounts', (event: IpcMainEvent) => {
|
||||||
accountManager
|
accountManager
|
||||||
.listAccounts()
|
.listAccounts()
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -394,7 +394,7 @@ ipcMain.on('list-accounts', (event: Event) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-local-account', (event: Event, id: string) => {
|
ipcMain.on('get-local-account', (event: IpcMainEvent, id: string) => {
|
||||||
accountManager
|
accountManager
|
||||||
.getAccount(id)
|
.getAccount(id)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -406,7 +406,7 @@ ipcMain.on('get-local-account', (event: Event, id: string) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('update-account', (event: Event, acct: LocalAccount) => {
|
ipcMain.on('update-account', (event: IpcMainEvent, acct: LocalAccount) => {
|
||||||
accountManager
|
accountManager
|
||||||
.refresh(acct)
|
.refresh(acct)
|
||||||
.then(ac => {
|
.then(ac => {
|
||||||
@ -417,7 +417,7 @@ ipcMain.on('update-account', (event: Event, acct: LocalAccount) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('remove-account', (event: Event, id: string) => {
|
ipcMain.on('remove-account', (event: IpcMainEvent, id: string) => {
|
||||||
accountManager
|
accountManager
|
||||||
.removeAccount(id)
|
.removeAccount(id)
|
||||||
.then(id => {
|
.then(id => {
|
||||||
@ -429,7 +429,7 @@ ipcMain.on('remove-account', (event: Event, id: string) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('forward-account', (event: Event, acct: LocalAccount) => {
|
ipcMain.on('forward-account', (event: IpcMainEvent, acct: LocalAccount) => {
|
||||||
accountManager
|
accountManager
|
||||||
.forwardAccount(acct)
|
.forwardAccount(acct)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -441,7 +441,7 @@ ipcMain.on('forward-account', (event: Event, acct: LocalAccount) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('backward-account', (event: Event, acct: LocalAccount) => {
|
ipcMain.on('backward-account', (event: IpcMainEvent, acct: LocalAccount) => {
|
||||||
accountManager
|
accountManager
|
||||||
.backwardAccount(acct)
|
.backwardAccount(acct)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -452,7 +452,7 @@ ipcMain.on('backward-account', (event: Event, acct: LocalAccount) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('refresh-accounts', (event: Event) => {
|
ipcMain.on('refresh-accounts', (event: IpcMainEvent) => {
|
||||||
accountManager
|
accountManager
|
||||||
.refreshAccounts()
|
.refreshAccounts()
|
||||||
.then(accounts => {
|
.then(accounts => {
|
||||||
@ -463,7 +463,7 @@ ipcMain.on('refresh-accounts', (event: Event) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('remove-all-accounts', (event: Event) => {
|
ipcMain.on('remove-all-accounts', (event: IpcMainEvent) => {
|
||||||
accountManager
|
accountManager
|
||||||
.removeAll()
|
.removeAll()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -475,7 +475,7 @@ ipcMain.on('remove-all-accounts', (event: Event) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('change-auto-launch', (event: Event, enable: boolean) => {
|
ipcMain.on('change-auto-launch', (event: IpcMainEvent, enable: boolean) => {
|
||||||
if (launcher) {
|
if (launcher) {
|
||||||
launcher.isEnabled().then(enabled => {
|
launcher.isEnabled().then(enabled => {
|
||||||
if (!enabled && enable && launcher) {
|
if (!enabled && enable && launcher) {
|
||||||
@ -500,7 +500,7 @@ ipcMain.on('reset-badge', () => {
|
|||||||
// user streaming
|
// user streaming
|
||||||
let userStreamings: { [key: string]: WebSocket | null } = {}
|
let userStreamings: { [key: string]: WebSocket | null } = {}
|
||||||
|
|
||||||
ipcMain.on('start-all-user-streamings', (event: Event, accounts: Array<LocalAccount>) => {
|
ipcMain.on('start-all-user-streamings', (event: IpcMainEvent, accounts: Array<LocalAccount>) => {
|
||||||
accounts.map(async account => {
|
accounts.map(async account => {
|
||||||
const id: string = account._id!
|
const id: string = account._id!
|
||||||
try {
|
try {
|
||||||
@ -610,7 +610,7 @@ type StreamingSetting = {
|
|||||||
|
|
||||||
let directMessagesStreaming: WebSocket | null = null
|
let directMessagesStreaming: WebSocket | null = null
|
||||||
|
|
||||||
ipcMain.on('start-directmessages-streaming', async (event: Event, obj: StreamingSetting) => {
|
ipcMain.on('start-directmessages-streaming', async (event: IpcMainEvent, obj: StreamingSetting) => {
|
||||||
const { account } = obj
|
const { account } = obj
|
||||||
try {
|
try {
|
||||||
const acct = await accountManager.getAccount(account._id!)
|
const acct = await accountManager.getAccount(account._id!)
|
||||||
@ -659,7 +659,7 @@ ipcMain.on('stop-directmessages-streaming', () => {
|
|||||||
|
|
||||||
let localStreaming: WebSocket | null = null
|
let localStreaming: WebSocket | null = null
|
||||||
|
|
||||||
ipcMain.on('start-local-streaming', async (event: Event, obj: StreamingSetting) => {
|
ipcMain.on('start-local-streaming', async (event: IpcMainEvent, obj: StreamingSetting) => {
|
||||||
const { account } = obj
|
const { account } = obj
|
||||||
try {
|
try {
|
||||||
const acct = await accountManager.getAccount(account._id!)
|
const acct = await accountManager.getAccount(account._id!)
|
||||||
@ -708,7 +708,7 @@ ipcMain.on('stop-local-streaming', () => {
|
|||||||
|
|
||||||
let publicStreaming: WebSocket | null = null
|
let publicStreaming: WebSocket | null = null
|
||||||
|
|
||||||
ipcMain.on('start-public-streaming', async (event: Event, obj: StreamingSetting) => {
|
ipcMain.on('start-public-streaming', async (event: IpcMainEvent, obj: StreamingSetting) => {
|
||||||
const { account } = obj
|
const { account } = obj
|
||||||
try {
|
try {
|
||||||
const acct = await accountManager.getAccount(account._id!)
|
const acct = await accountManager.getAccount(account._id!)
|
||||||
@ -761,7 +761,7 @@ type ListID = {
|
|||||||
listID: string
|
listID: string
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.on('start-list-streaming', async (event: Event, obj: ListID & StreamingSetting) => {
|
ipcMain.on('start-list-streaming', async (event: IpcMainEvent, obj: ListID & StreamingSetting) => {
|
||||||
const { listID, account } = obj
|
const { listID, account } = obj
|
||||||
try {
|
try {
|
||||||
const acct = await accountManager.getAccount(account._id!)
|
const acct = await accountManager.getAccount(account._id!)
|
||||||
@ -814,7 +814,7 @@ type Tag = {
|
|||||||
tag: string
|
tag: string
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.on('start-tag-streaming', async (event: Event, obj: Tag & StreamingSetting) => {
|
ipcMain.on('start-tag-streaming', async (event: IpcMainEvent, obj: Tag & StreamingSetting) => {
|
||||||
const { tag, account } = obj
|
const { tag, account } = obj
|
||||||
try {
|
try {
|
||||||
const acct = await accountManager.getAccount(account._id!)
|
const acct = await accountManager.getAccount(account._id!)
|
||||||
@ -893,7 +893,7 @@ ipcMain.on('toot-action-sound', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// preferences
|
// preferences
|
||||||
ipcMain.on('get-preferences', async (event: Event) => {
|
ipcMain.on('get-preferences', async (event: IpcMainEvent) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
let enabled = false
|
let enabled = false
|
||||||
if (launcher) {
|
if (launcher) {
|
||||||
@ -912,7 +912,7 @@ ipcMain.on('get-preferences', async (event: Event) => {
|
|||||||
event.sender.send('response-get-preferences', conf)
|
event.sender.send('response-get-preferences', conf)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('update-preferences', (event: Event, data: any) => {
|
ipcMain.on('update-preferences', (event: IpcMainEvent, data: any) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences
|
preferences
|
||||||
.update(data)
|
.update(data)
|
||||||
@ -924,7 +924,7 @@ ipcMain.on('update-preferences', (event: Event, data: any) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('change-collapse', (_event: Event, value: boolean) => {
|
ipcMain.on('change-collapse', (_event: IpcMainEvent, value: boolean) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences
|
preferences
|
||||||
.update({
|
.update({
|
||||||
@ -937,14 +937,14 @@ ipcMain.on('change-collapse', (_event: Event, value: boolean) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-collapse', (event: Event) => {
|
ipcMain.on('get-collapse', (event: IpcMainEvent) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences.load().then(conf => {
|
preferences.load().then(conf => {
|
||||||
event.sender.send('response-get-collapse', conf.state.collapse)
|
event.sender.send('response-get-collapse', conf.state.collapse)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('change-global-header', (event: Event, value: boolean) => {
|
ipcMain.on('change-global-header', (event: IpcMainEvent, value: boolean) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences
|
preferences
|
||||||
.update({
|
.update({
|
||||||
@ -960,7 +960,7 @@ ipcMain.on('change-global-header', (event: Event, value: boolean) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-global-header', (event: Event) => {
|
ipcMain.on('get-global-header', (event: IpcMainEvent) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences.load().then(conf => {
|
preferences.load().then(conf => {
|
||||||
event.sender.send('response-get-global-header', conf.state.hideGlobalHeader)
|
event.sender.send('response-get-global-header', conf.state.hideGlobalHeader)
|
||||||
@ -968,7 +968,7 @@ ipcMain.on('get-global-header', (event: Event) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// proxy
|
// proxy
|
||||||
ipcMain.on('update-proxy-config', (event: Event, proxy: Proxy) => {
|
ipcMain.on('update-proxy-config', (event: IpcMainEvent, proxy: Proxy) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences
|
preferences
|
||||||
.update({
|
.update({
|
||||||
@ -983,7 +983,7 @@ ipcMain.on('update-proxy-config', (event: Event, proxy: Proxy) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// language
|
// language
|
||||||
ipcMain.on('change-language', (event: Event, value: string) => {
|
ipcMain.on('change-language', (event: IpcMainEvent, value: string) => {
|
||||||
const preferences = new Preferences(preferencesDBPath)
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
preferences
|
preferences
|
||||||
.update({
|
.update({
|
||||||
@ -998,7 +998,7 @@ ipcMain.on('change-language', (event: Event, value: string) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// hashtag
|
// hashtag
|
||||||
ipcMain.on('save-hashtag', (event: Event, tag: string) => {
|
ipcMain.on('save-hashtag', (event: IpcMainEvent, tag: string) => {
|
||||||
const hashtags = new Hashtags(hashtagsDB)
|
const hashtags = new Hashtags(hashtagsDB)
|
||||||
hashtags
|
hashtags
|
||||||
.insertTag(tag)
|
.insertTag(tag)
|
||||||
@ -1010,7 +1010,7 @@ ipcMain.on('save-hashtag', (event: Event, tag: string) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('list-hashtags', (event: Event) => {
|
ipcMain.on('list-hashtags', (event: IpcMainEvent) => {
|
||||||
const hashtags = new Hashtags(hashtagsDB)
|
const hashtags = new Hashtags(hashtagsDB)
|
||||||
hashtags
|
hashtags
|
||||||
.listTags()
|
.listTags()
|
||||||
@ -1022,7 +1022,7 @@ ipcMain.on('list-hashtags', (event: Event) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('remove-hashtag', (event: Event, tag: LocalTag) => {
|
ipcMain.on('remove-hashtag', (event: IpcMainEvent, tag: LocalTag) => {
|
||||||
const hashtags = new Hashtags(hashtagsDB)
|
const hashtags = new Hashtags(hashtagsDB)
|
||||||
hashtags
|
hashtags
|
||||||
.removeTag(tag)
|
.removeTag(tag)
|
||||||
@ -1035,7 +1035,7 @@ ipcMain.on('remove-hashtag', (event: Event, tag: LocalTag) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Fonts
|
// Fonts
|
||||||
ipcMain.on('list-fonts', (event: Event) => {
|
ipcMain.on('list-fonts', (event: IpcMainEvent) => {
|
||||||
Fonts()
|
Fonts()
|
||||||
.then(list => {
|
.then(list => {
|
||||||
event.sender.send('response-list-fonts', list)
|
event.sender.send('response-list-fonts', list)
|
||||||
@ -1046,7 +1046,7 @@ ipcMain.on('list-fonts', (event: Event) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Unread notifications
|
// Unread notifications
|
||||||
ipcMain.on('get-unread-notification', (event: Event, accountID: string) => {
|
ipcMain.on('get-unread-notification', (event: IpcMainEvent, accountID: string) => {
|
||||||
unreadNotification
|
unreadNotification
|
||||||
.findOne({
|
.findOne({
|
||||||
accountID: accountID
|
accountID: accountID
|
||||||
@ -1060,7 +1060,7 @@ ipcMain.on('get-unread-notification', (event: Event, accountID: string) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('update-unread-notification', (event: Event, config: UnreadNotificationConfig) => {
|
ipcMain.on('update-unread-notification', (event: IpcMainEvent, config: UnreadNotificationConfig) => {
|
||||||
const { accountID } = config
|
const { accountID } = config
|
||||||
unreadNotification
|
unreadNotification
|
||||||
.insertOrUpdate(accountID!, config)
|
.insertOrUpdate(accountID!, config)
|
||||||
@ -1074,24 +1074,24 @@ ipcMain.on('update-unread-notification', (event: Event, config: UnreadNotificati
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
ipcMain.on('get-cache-hashtags', async (event: Event) => {
|
ipcMain.on('get-cache-hashtags', async (event: IpcMainEvent) => {
|
||||||
const tags = await hashtagCache.listTags()
|
const tags = await hashtagCache.listTags()
|
||||||
event.sender.send('response-get-cache-hashtags', tags)
|
event.sender.send('response-get-cache-hashtags', tags)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('insert-cache-hashtags', (event: Event, tags: Array<string>) => {
|
ipcMain.on('insert-cache-hashtags', (event: IpcMainEvent, tags: Array<string>) => {
|
||||||
tags.map(async name => {
|
tags.map(async name => {
|
||||||
await hashtagCache.insertHashtag(name).catch(err => console.error(err))
|
await hashtagCache.insertHashtag(name).catch(err => console.error(err))
|
||||||
})
|
})
|
||||||
event.sender.send('response-insert-cache-hashtags')
|
event.sender.send('response-insert-cache-hashtags')
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-cache-accounts', async (event: Event, ownerID: string) => {
|
ipcMain.on('get-cache-accounts', async (event: IpcMainEvent, ownerID: string) => {
|
||||||
const accounts = await accountCache.listAccounts(ownerID)
|
const accounts = await accountCache.listAccounts(ownerID)
|
||||||
event.sender.send('response-get-cache-accounts', accounts)
|
event.sender.send('response-get-cache-accounts', accounts)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('insert-cache-accounts', (event: Event, obj: InsertAccountCache) => {
|
ipcMain.on('insert-cache-accounts', (event: IpcMainEvent, obj: InsertAccountCache) => {
|
||||||
const { ownerID, accts } = obj
|
const { ownerID, accts } = obj
|
||||||
accts.map(async acct => {
|
accts.map(async acct => {
|
||||||
await accountCache.insertAccount(ownerID, acct).catch(err => console.error(err))
|
await accountCache.insertAccount(ownerID, acct).catch(err => console.error(err))
|
||||||
@ -1143,8 +1143,7 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, i18n
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.t('main_menu.application.services'),
|
label: i18n.t('main_menu.application.services'),
|
||||||
role: 'services',
|
role: 'services'
|
||||||
submenu: []
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
@ -1155,7 +1154,7 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, i18n
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.t('main_menu.application.hide_others'),
|
label: i18n.t('main_menu.application.hide_others'),
|
||||||
role: 'hideothers'
|
role: 'hideOthers'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.t('main_menu.application.show_all'),
|
label: i18n.t('main_menu.application.show_all'),
|
||||||
@ -1253,7 +1252,7 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, i18n
|
|||||||
accelerator: 'CmdOrCtrl+A',
|
accelerator: 'CmdOrCtrl+A',
|
||||||
role: 'selectall'
|
role: 'selectall'
|
||||||
}
|
}
|
||||||
]
|
] as Array<MenuItemConstructorOptions>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.t('main_menu.view.name'),
|
label: i18n.t('main_menu.view.name'),
|
||||||
|
@ -49,7 +49,7 @@ const actions: ActionTree<AccountState, RootState> = {
|
|||||||
ipcRenderer.removeAllListeners('response-remove-account')
|
ipcRenderer.removeAllListeners('response-remove-account')
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
ipcRenderer.once('response-remove-account', (_id: string) => {
|
ipcRenderer.once('response-remove-account', (_, _id: string) => {
|
||||||
ipcRenderer.removeAllListeners('error-remove-account')
|
ipcRenderer.removeAllListeners('error-remove-account')
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user