mirror of
https://github.com/rhysd/Mstdn.git
synced 2025-01-21 20:52:11 +01:00
tslint
This commit is contained in:
parent
7038f356db
commit
ba8fd685bb
@ -3,7 +3,7 @@ import {app, BrowserWindow, globalShortcut, Tray, shell} from 'electron';
|
|||||||
import windowState = require('electron-window-state');
|
import windowState = require('electron-window-state');
|
||||||
import * as menubar from 'menubar';
|
import * as menubar from 'menubar';
|
||||||
import log from './log';
|
import log from './log';
|
||||||
import {Config, Account} from './config'
|
import {Config, Account} from './config';
|
||||||
|
|
||||||
const IS_DEBUG = process.env.NODE_ENV === 'development';
|
const IS_DEBUG = process.env.NODE_ENV === 'development';
|
||||||
const IS_DARWIN = process.platform === 'darwin';
|
const IS_DARWIN = process.platform === 'darwin';
|
||||||
@ -44,7 +44,7 @@ function trayIcon(color: string) {
|
|||||||
}@2x.png`);
|
}@2x.png`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function startApp (config: Config) {
|
export default function startApp(config: Config) {
|
||||||
return (config.normal_window ? startNormalWindow : startMenuBar)(config)
|
return (config.normal_window ? startNormalWindow : startMenuBar)(config)
|
||||||
.then(win => new App(win, config));
|
.then(win => new App(win, config));
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ function showDyingDialog(title: string, detail: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function recommendConfigAndDie(file: string) {
|
function recommendConfigAndDie(file: string) {
|
||||||
const title = 'Please write configuration in JSON'
|
const title = 'Please write configuration in JSON';
|
||||||
const detail = 'You need to write up name and host in first item of accounts. Restart this app after writing up them. Please see README for more detail: https://github.com/rhysd/Mstdn#readme';
|
const detail = 'You need to write up name and host in first item of accounts. Restart this app after writing up them. Please see README for more detail: https://github.com/rhysd/Mstdn#readme';
|
||||||
shell.openItem(file);
|
shell.openItem(file);
|
||||||
showDyingDialog(title, detail);
|
showDyingDialog(title, detail);
|
||||||
@ -101,7 +101,7 @@ export default function loadConfig(): Promise<Config> {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.debug('Error on loading JSON file', e);
|
log.debug('Error on loading JSON file', e);
|
||||||
showDyingDialog('Error on loading JSON file', e.message)
|
showDyingDialog('Error on loading JSON file', e.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -25,7 +25,7 @@ const ShortcutActions = {
|
|||||||
'scroll-up': () => {
|
'scroll-up': () => {
|
||||||
scrollable().scrollTop -= window.innerHeight / 3;
|
scrollable().scrollTop -= window.innerHeight / 3;
|
||||||
},
|
},
|
||||||
} as {[action: string]: () => void}
|
} as {[action: string]: () => void};
|
||||||
|
|
||||||
function setupKeybinds(keybinds: {[key: string]: string}, host: string) {
|
function setupKeybinds(keybinds: {[key: string]: string}, host: string) {
|
||||||
for (const key in keybinds) {
|
for (const key in keybinds) {
|
||||||
|
@ -3,7 +3,7 @@ import r from './require';
|
|||||||
const electron = r('electron');
|
const electron = r('electron');
|
||||||
const ipc = electron.ipcRenderer;
|
const ipc = electron.ipcRenderer;
|
||||||
|
|
||||||
export function on(channel: IpcChannel, callback: Function) {
|
export function on(channel: IpcChannel, callback: (...args: any[]) => void) {
|
||||||
ipc.on(channel, (...args: any[]) => {
|
ipc.on(channel, (...args: any[]) => {
|
||||||
log.debug('IPC: Received from:', channel, args);
|
log.debug('IPC: Received from:', channel, args);
|
||||||
callback(...args);
|
callback(...args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user