@electerm/electerm-react 1.39.103 → 1.39.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,6 @@ import deepCopy from 'json-deep-copy'
30
30
  import isValidPath from '../../common/is-valid-path'
31
31
  import memoizeOne from 'memoize-one'
32
32
  import postMessage from '../../common/post-msg'
33
- import { runCmd } from '../terminal/terminal-apis'
34
33
  import * as owner from './owner-list'
35
34
  import AddressBar from './address-bar'
36
35
  import getProxy from '../../common/get-proxy'
@@ -252,11 +251,7 @@ export default class Sftp extends Component {
252
251
  if (this.props.sftpPathFollowSsh && this.props.cwd) {
253
252
  return this.props.cwd
254
253
  }
255
- const home = await runCmd(
256
- this.props.pid,
257
- this.props.sessionId,
258
- 'pwd'
259
- ).catch(window.store.onError)
254
+ const home = await this.sftp.getHomeDir()
260
255
  if (home) {
261
256
  return home.trim()
262
257
  } else {
@@ -117,8 +117,21 @@ export default (Store) => {
117
117
  }
118
118
 
119
119
  Store.prototype.handleClearSyncSetting = async function () {
120
- window.store.setConfig({
121
- syncSetting: {}
120
+ const { store } = window
121
+ const currentSyncType = store.syncType
122
+ const currentSettings = store.config.syncSetting || {}
123
+ console.log('currentSettings: ', currentSyncType, currentSettings)
124
+ // Create a new object without the current sync type's settings
125
+ const updatedSettings = Object.keys(currentSettings).reduce((acc, key) => {
126
+ if (!key.startsWith(currentSyncType)) {
127
+ acc[key] = currentSettings[key]
128
+ }
129
+ return acc
130
+ }, {})
131
+ console.log('updatedSettings: ', updatedSettings)
132
+
133
+ store.setConfig({
134
+ syncSetting: updatedSettings
122
135
  })
123
136
  }
124
137
 
@@ -346,7 +359,7 @@ export default (Store) => {
346
359
  Store.prototype.handleExportAllData = async function () {
347
360
  const { store } = window
348
361
  const objs = {}
349
- const names = store.getDataSyncNames(true)
362
+ const { names } = store.getDataSyncNames(true)
350
363
  for (const n of names) {
351
364
  objs[n] = store.getItems(n)
352
365
  const order = await getData(`${n}:order`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.39.103",
3
+ "version": "1.39.109",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",