diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-05-26 21:05:50 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 21:05:50 +0530 |
commit | 296ce5ce62bcde6888df291f97105fa912ed7d35 (patch) | |
tree | b28e7d2373f1020c1183469aa3a9feafecede569 /src/features | |
parent | Added new entry in context menu: 'Download image' (#1449) (diff) | |
download | ferdium-app-296ce5ce62bcde6888df291f97105fa912ed7d35.tar.gz ferdium-app-296ce5ce62bcde6888df291f97105fa912ed7d35.tar.zst ferdium-app-296ce5ce62bcde6888df291f97105fa912ed7d35.zip |
Replace 'remote' with 'electron/remote' (#1448)
* Locked new version of 'recipes' submodule with corresponding changes.
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/announcements/api.js | 4 | ||||
-rw-r--r-- | src/features/planSelection/containers/PlanSelectionScreen.js | 4 | ||||
-rw-r--r-- | src/features/quickSwitch/Component.js | 6 | ||||
-rw-r--r-- | src/features/serviceProxy/index.js | 8 | ||||
-rw-r--r-- | src/features/workspaces/components/WorkspaceDrawerItem.js | 6 |
5 files changed, 9 insertions, 19 deletions
diff --git a/src/features/announcements/api.js b/src/features/announcements/api.js index e5c5a7d6f..2ab5a15b2 100644 --- a/src/features/announcements/api.js +++ b/src/features/announcements/api.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { remote } from 'electron'; | 1 | import { app } from '@electron/remote'; |
2 | import Request from '../../stores/lib/Request'; | 2 | import Request from '../../stores/lib/Request'; |
3 | 3 | ||
4 | const debug = require('debug')('Ferdi:feature:announcements:api'); | 4 | const debug = require('debug')('Ferdi:feature:announcements:api'); |
@@ -6,7 +6,7 @@ const debug = require('debug')('Ferdi:feature:announcements:api'); | |||
6 | export const announcementsApi = { | 6 | export const announcementsApi = { |
7 | async getCurrentVersion() { | 7 | async getCurrentVersion() { |
8 | debug('getting current version of electron app'); | 8 | debug('getting current version of electron app'); |
9 | return Promise.resolve(remote.app.getVersion()); | 9 | return Promise.resolve(app.getVersion()); |
10 | }, | 10 | }, |
11 | 11 | ||
12 | async getChangelog(version) { | 12 | async getChangelog(version) { |
diff --git a/src/features/planSelection/containers/PlanSelectionScreen.js b/src/features/planSelection/containers/PlanSelectionScreen.js index e4d85cda5..fba65506e 100644 --- a/src/features/planSelection/containers/PlanSelectionScreen.js +++ b/src/features/planSelection/containers/PlanSelectionScreen.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import { observer, inject } from 'mobx-react'; | 2 | import { observer, inject } from 'mobx-react'; |
3 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
4 | import { remote } from 'electron'; | 4 | import { dialog, app } from '@electron/remote'; |
5 | import { defineMessages, intlShape } from 'react-intl'; | 5 | import { defineMessages, intlShape } from 'react-intl'; |
6 | 6 | ||
7 | import FeaturesStore from '../../../stores/FeaturesStore'; | 7 | import FeaturesStore from '../../../stores/FeaturesStore'; |
@@ -10,8 +10,6 @@ import PlanSelection from '../components/PlanSelection'; | |||
10 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | 10 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; |
11 | import { planSelectionStore } from '..'; | 11 | import { planSelectionStore } from '..'; |
12 | 12 | ||
13 | const { dialog, app } = remote; | ||
14 | |||
15 | const messages = defineMessages({ | 13 | const messages = defineMessages({ |
16 | dialogTitle: { | 14 | dialogTitle: { |
17 | id: 'feature.planSelection.fullscreen.dialog.title', | 15 | id: 'feature.planSelection.fullscreen.dialog.title', |
diff --git a/src/features/quickSwitch/Component.js b/src/features/quickSwitch/Component.js index 58479e7ef..c5c320f52 100644 --- a/src/features/quickSwitch/Component.js +++ b/src/features/quickSwitch/Component.js | |||
@@ -1,5 +1,5 @@ | |||
1 | import React, { Component, createRef } from 'react'; | 1 | import React, { Component, createRef } from 'react'; |
2 | import { remote } from 'electron'; | 2 | import { getCurrentWindow } from '@electron/remote'; |
3 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
4 | import { observer, inject } from 'mobx-react'; | 4 | import { observer, inject } from 'mobx-react'; |
5 | import { reaction } from 'mobx'; | 5 | import { reaction } from 'mobx'; |
@@ -244,8 +244,8 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class | |||
244 | if (isModalVisible && !this.state.wasPrevVisible) { | 244 | if (isModalVisible && !this.state.wasPrevVisible) { |
245 | // Set focus back on current window if its in a service | 245 | // Set focus back on current window if its in a service |
246 | // TODO: Find a way to gain back focus | 246 | // TODO: Find a way to gain back focus |
247 | remote.getCurrentWindow().blurWebView(); | 247 | getCurrentWindow().blurWebView(); |
248 | remote.getCurrentWindow().webContents.focus(); | 248 | getCurrentWindow().webContents.focus(); |
249 | 249 | ||
250 | // The input "focus" attribute will only work on first modal open | 250 | // The input "focus" attribute will only work on first modal open |
251 | // Manually add focus to the input element | 251 | // Manually add focus to the input element |
diff --git a/src/features/serviceProxy/index.js b/src/features/serviceProxy/index.js index e78607667..f74f5f0b2 100644 --- a/src/features/serviceProxy/index.js +++ b/src/features/serviceProxy/index.js | |||
@@ -1,9 +1,5 @@ | |||
1 | import { autorun, observable } from 'mobx'; | 1 | import { autorun, observable } from 'mobx'; |
2 | import { remote } from 'electron'; | 2 | import { session } from '@electron/remote'; |
3 | |||
4 | // import { DEFAULT_FEATURES_CONFIG } from '../../config'; | ||
5 | |||
6 | const { session } = remote; | ||
7 | 3 | ||
8 | const debug = require('debug')('Ferdi:feature:serviceProxy'); | 4 | const debug = require('debug')('Ferdi:feature:serviceProxy'); |
9 | 5 | ||
@@ -16,8 +12,6 @@ export default function init(stores) { | |||
16 | debug('Initializing `serviceProxy` feature'); | 12 | debug('Initializing `serviceProxy` feature'); |
17 | 13 | ||
18 | autorun(() => { | 14 | autorun(() => { |
19 | // const { isServiceProxyEnabled, isServiceProxyIncludedInCurrentPlan } = stores.features.features; | ||
20 | |||
21 | config.isEnabled = true; | 15 | config.isEnabled = true; |
22 | config.isIncludedInCurrentPlan = true; | 16 | config.isIncludedInCurrentPlan = true; |
23 | 17 | ||
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js index 18f424d8a..2e58b70d6 100644 --- a/src/features/workspaces/components/WorkspaceDrawerItem.js +++ b/src/features/workspaces/components/WorkspaceDrawerItem.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { remote } from 'electron'; | 1 | import { Menu, getCurrentWindow } from '@electron/remote'; |
2 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
3 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
4 | import { observer } from 'mobx-react'; | 4 | import { observer } from 'mobx-react'; |
@@ -7,8 +7,6 @@ import classnames from 'classnames'; | |||
7 | import { defineMessages, intlShape } from 'react-intl'; | 7 | import { defineMessages, intlShape } from 'react-intl'; |
8 | import { ctrlKey } from '../../../environment'; | 8 | import { ctrlKey } from '../../../environment'; |
9 | 9 | ||
10 | const { Menu } = remote; | ||
11 | |||
12 | const messages = defineMessages({ | 10 | const messages = defineMessages({ |
13 | noServicesAddedYet: { | 11 | noServicesAddedYet: { |
14 | id: 'workspaceDrawer.item.noServicesAddedYet', | 12 | id: 'workspaceDrawer.item.noServicesAddedYet', |
@@ -113,7 +111,7 @@ class WorkspaceDrawerItem extends Component { | |||
113 | ])} | 111 | ])} |
114 | onClick={onClick} | 112 | onClick={onClick} |
115 | onContextMenu={() => ( | 113 | onContextMenu={() => ( |
116 | onContextMenuEditClick && contextMenu.popup(remote.getCurrentWindow()) | 114 | onContextMenuEditClick && contextMenu.popup(getCurrentWindow()) |
117 | )} | 115 | )} |
118 | data-tip={`${shortcutIndex <= 9 ? `(${ctrlKey}+Alt+${shortcutIndex})` : ''}`} | 116 | data-tip={`${shortcutIndex <= 9 ? `(${ctrlKey}+Alt+${shortcutIndex})` : ''}`} |
119 | > | 117 | > |