Skip to content

Commit 1b0c561

Browse files
committed
s/IntegrationManager/Platform/
Because we call bots integrations and I'll get confused
1 parent ddb2ff5 commit 1b0c561

5 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎src/vector/integration/index.js‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/vector/integration/BaseIntegrationManager.js renamed to src/vector/platform/BasePlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
export default class BaseIntegrationManager {
3+
export default class BasePlatform {
44
constructor() {
55
this.notificationCount = 0;
66
this.errorDidOccur = false;

src/vector/integration/ElectronIntegrationManager.js renamed to src/vector/platform/ElectronPlatform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
import BaseIntegrationManager from './BaseIntegrationManager';
2+
import BasePlatform from './BasePlatform';
33

44
// index.js imports us unconditionally, so we need this check here as well
55
let electron = null, remote = null;
@@ -8,7 +8,7 @@ if (window && window.process && window.process && window.process.type === 'rende
88
remote = electron.remote;
99
}
1010

11-
export default class ElectronIntegrationManager extends BaseIntegrationManager {
11+
export default class ElectronPlatform extends BasePlatform {
1212
setNotificationCount(count: number) {
1313
super.setNotificationCount(count);
1414
remote.app.setBadgeCount(count);

src/vector/integration/WebIntegrationManager.js renamed to src/vector/platform/WebPlatform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @flow
2-
import BaseIntegrationManager from './BaseIntegrationManager';
2+
import BasePlatform from './BasePlatform';
33
import Favico from 'favico.js';
44

5-
export default class WebIntegrationManager extends BaseIntegrationManager {
5+
export default class WebPlatform extends BasePlatform {
66
constructor() {
77
super();
88
this.favicon = new Favico({animation: 'popFade'});

‎src/vector/platform/index.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @flow
2+
3+
import ElectronPlatform from './ElectronPlatform';
4+
import WebPlatform from './WebPlatform';
5+
6+
let Platform = null;
7+
8+
if (window && window.process && window.process && window.process.type === 'renderer') {
9+
// we're running inside electron
10+
Platform = ElectronPlatform;
11+
} else {
12+
Platform = WebPlatform;
13+
}
14+
15+
export default Platform;

0 commit comments

Comments
 (0)