s/IntegrationManager/Platform/
Because we call bots integrations and I'll get confused
This commit is contained in:
parent
ddb2ff5994
commit
1b0c561ac1
5 changed files with 20 additions and 20 deletions
|
@ -1,15 +0,0 @@
|
|||
// @flow
|
||||
|
||||
import ElectronIntegrationManager from './ElectronIntegrationManager';
|
||||
import WebIntegrationManager from './WebIntegrationManager';
|
||||
|
||||
let IntegrationManager = null;
|
||||
|
||||
if (window && window.process && window.process && window.process.type === 'renderer') {
|
||||
// we're running inside electron
|
||||
IntegrationManager = ElectronIntegrationManager;
|
||||
} else {
|
||||
IntegrationManager = WebIntegrationManager;
|
||||
}
|
||||
|
||||
export default IntegrationManager;
|
|
@ -1,6 +1,6 @@
|
|||
// @flow
|
||||
|
||||
export default class BaseIntegrationManager {
|
||||
export default class BasePlatform {
|
||||
constructor() {
|
||||
this.notificationCount = 0;
|
||||
this.errorDidOccur = false;
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import BaseIntegrationManager from './BaseIntegrationManager';
|
||||
import BasePlatform from './BasePlatform';
|
||||
|
||||
// index.js imports us unconditionally, so we need this check here as well
|
||||
let electron = null, remote = null;
|
||||
|
@ -8,7 +8,7 @@ if (window && window.process && window.process && window.process.type === 'rende
|
|||
remote = electron.remote;
|
||||
}
|
||||
|
||||
export default class ElectronIntegrationManager extends BaseIntegrationManager {
|
||||
export default class ElectronPlatform extends BasePlatform {
|
||||
setNotificationCount(count: number) {
|
||||
super.setNotificationCount(count);
|
||||
remote.app.setBadgeCount(count);
|
|
@ -1,8 +1,8 @@
|
|||
// @flow
|
||||
import BaseIntegrationManager from './BaseIntegrationManager';
|
||||
import BasePlatform from './BasePlatform';
|
||||
import Favico from 'favico.js';
|
||||
|
||||
export default class WebIntegrationManager extends BaseIntegrationManager {
|
||||
export default class WebPlatform extends BasePlatform {
|
||||
constructor() {
|
||||
super();
|
||||
this.favicon = new Favico({animation: 'popFade'});
|
15
src/vector/platform/index.js
Normal file
15
src/vector/platform/index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
// @flow
|
||||
|
||||
import ElectronPlatform from './ElectronPlatform';
|
||||
import WebPlatform from './WebPlatform';
|
||||
|
||||
let Platform = null;
|
||||
|
||||
if (window && window.process && window.process && window.process.type === 'renderer') {
|
||||
// we're running inside electron
|
||||
Platform = ElectronPlatform;
|
||||
} else {
|
||||
Platform = WebPlatform;
|
||||
}
|
||||
|
||||
export default Platform;
|
Loading…
Add table
Reference in a new issue