s/IntegrationManager/Platform/

Because we call bots integrations and I'll get confused
This commit is contained in:
David Baker 2016-10-20 14:50:20 +01:00
parent ddb2ff5994
commit 1b0c561ac1
5 changed files with 20 additions and 20 deletions

View file

@ -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;

View file

@ -1,6 +1,6 @@
// @flow // @flow
export default class BaseIntegrationManager { export default class BasePlatform {
constructor() { constructor() {
this.notificationCount = 0; this.notificationCount = 0;
this.errorDidOccur = false; this.errorDidOccur = false;

View file

@ -1,5 +1,5 @@
// @flow // @flow
import BaseIntegrationManager from './BaseIntegrationManager'; import BasePlatform from './BasePlatform';
// index.js imports us unconditionally, so we need this check here as well // index.js imports us unconditionally, so we need this check here as well
let electron = null, remote = null; let electron = null, remote = null;
@ -8,7 +8,7 @@ if (window && window.process && window.process && window.process.type === 'rende
remote = electron.remote; remote = electron.remote;
} }
export default class ElectronIntegrationManager extends BaseIntegrationManager { export default class ElectronPlatform extends BasePlatform {
setNotificationCount(count: number) { setNotificationCount(count: number) {
super.setNotificationCount(count); super.setNotificationCount(count);
remote.app.setBadgeCount(count); remote.app.setBadgeCount(count);

View file

@ -1,8 +1,8 @@
// @flow // @flow
import BaseIntegrationManager from './BaseIntegrationManager'; import BasePlatform from './BasePlatform';
import Favico from 'favico.js'; import Favico from 'favico.js';
export default class WebIntegrationManager extends BaseIntegrationManager { export default class WebPlatform extends BasePlatform {
constructor() { constructor() {
super(); super();
this.favicon = new Favico({animation: 'popFade'}); this.favicon = new Favico({animation: 'popFade'});

View 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;