From 1b0c561ac193cae8871d60a707a26e89d6bb2246 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 20 Oct 2016 14:50:20 +0100 Subject: [PATCH] s/IntegrationManager/Platform/ Because we call bots integrations and I'll get confused --- src/vector/integration/index.js | 15 --------------- .../BasePlatform.js} | 2 +- .../ElectronPlatform.js} | 4 ++-- .../WebPlatform.js} | 4 ++-- src/vector/platform/index.js | 15 +++++++++++++++ 5 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 src/vector/integration/index.js rename src/vector/{integration/BaseIntegrationManager.js => platform/BasePlatform.js} (86%) rename src/vector/{integration/ElectronIntegrationManager.js => platform/ElectronPlatform.js} (74%) rename src/vector/{integration/WebIntegrationManager.js => platform/WebPlatform.js} (88%) create mode 100644 src/vector/platform/index.js diff --git a/src/vector/integration/index.js b/src/vector/integration/index.js deleted file mode 100644 index 129c10b670..0000000000 --- a/src/vector/integration/index.js +++ /dev/null @@ -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; diff --git a/src/vector/integration/BaseIntegrationManager.js b/src/vector/platform/BasePlatform.js similarity index 86% rename from src/vector/integration/BaseIntegrationManager.js rename to src/vector/platform/BasePlatform.js index c83e2b2351..4330731f87 100644 --- a/src/vector/integration/BaseIntegrationManager.js +++ b/src/vector/platform/BasePlatform.js @@ -1,6 +1,6 @@ // @flow -export default class BaseIntegrationManager { +export default class BasePlatform { constructor() { this.notificationCount = 0; this.errorDidOccur = false; diff --git a/src/vector/integration/ElectronIntegrationManager.js b/src/vector/platform/ElectronPlatform.js similarity index 74% rename from src/vector/integration/ElectronIntegrationManager.js rename to src/vector/platform/ElectronPlatform.js index c0c72f1ee9..cecbd07762 100644 --- a/src/vector/integration/ElectronIntegrationManager.js +++ b/src/vector/platform/ElectronPlatform.js @@ -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); diff --git a/src/vector/integration/WebIntegrationManager.js b/src/vector/platform/WebPlatform.js similarity index 88% rename from src/vector/integration/WebIntegrationManager.js rename to src/vector/platform/WebPlatform.js index 21b5be64d8..479cf6914e 100644 --- a/src/vector/integration/WebIntegrationManager.js +++ b/src/vector/platform/WebPlatform.js @@ -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'}); diff --git a/src/vector/platform/index.js b/src/vector/platform/index.js new file mode 100644 index 0000000000..26beb0bab6 --- /dev/null +++ b/src/vector/platform/index.js @@ -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;