@electerm/electerm-react 1.60.48 → 1.60.50

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.
@@ -1250,7 +1250,7 @@ clear\r`
1250
1250
  items: this.renderContextMenu(),
1251
1251
  onClick: this.onContextMenu
1252
1252
  },
1253
- trigger: ['contextMenu']
1253
+ trigger: this.props.config.pasteWhenContextMenu ? [] : ['contextMenu']
1254
1254
  }
1255
1255
  return (
1256
1256
  <Dropdown {...dropdownProps}>
@@ -2,14 +2,13 @@
2
2
  * load data from db
3
3
  */
4
4
 
5
- import { dbNames, update, getData, fetchInitData, insert, remove } from '../common/db'
5
+ import { dbNames, getData, fetchInitData } from '../common/db'
6
6
  import parseInt10 from '../common/parse-int10'
7
7
  import { infoTabs, statusMap, defaultEnvLang } from '../common/constants'
8
8
  import fs from '../common/fs'
9
9
  import generate from '../common/id-with-stamp'
10
10
  import defaultSettings from '../common/default-setting'
11
11
  import encodes from '../components/bookmark-form/encodes'
12
- import runIdle from '../common/run-idle'
13
12
  import { initWsCommon } from '../common/fetch-from-server'
14
13
  import safeParse from '../common/parse-json-safe'
15
14
  import initWatch from './watch'
@@ -107,27 +106,6 @@ export async function addTabFromCommandLine (store, opts) {
107
106
  }
108
107
 
109
108
  export default (Store) => {
110
- Store.prototype.batchDbUpdate = async function (updates) {
111
- runIdle(() => {
112
- for (const u of updates) {
113
- update(u.id, u.update, u.db, u.upsert)
114
- }
115
- })
116
- }
117
- Store.prototype.batchDbAdd = async function (adds) {
118
- runIdle(() => {
119
- for (const u of adds) {
120
- insert(u.db, u.obj)
121
- }
122
- })
123
- }
124
- Store.prototype.batchDbDel = async function (dels) {
125
- runIdle(() => {
126
- for (const u of dels) {
127
- remove(u.db, u.id)
128
- }
129
- })
130
- }
131
109
  Store.prototype.openInitSessions = function () {
132
110
  const { store } = window
133
111
  const arr = store.config.onStartSessions || []
@@ -7,7 +7,7 @@ import copy from 'json-deep-copy'
7
7
  import {
8
8
  settingMap, packInfo, syncTypes, syncDataMaps
9
9
  } from '../common/constants'
10
- import { remove, dbNames, insert, update, getData } from '../common/db'
10
+ import { dbNames, update, getData } from '../common/db'
11
11
  import fetch from '../common/fetch-from-server'
12
12
  import download from '../common/download'
13
13
  import { fixBookmarks } from '../common/db-fix'
@@ -259,7 +259,6 @@ export default (Store) => {
259
259
  token,
260
260
  store.getProxySetting()
261
261
  )
262
- const toInsert = []
263
262
  const { names, syncConfig } = store.getDataSyncNames()
264
263
  for (const n of names) {
265
264
  let str = get(gist, `files["${n}.json"].content`)
@@ -290,10 +289,6 @@ export default (Store) => {
290
289
  return ai - bi
291
290
  })
292
291
  }
293
- toInsert.push({
294
- name: n,
295
- value: arr
296
- })
297
292
  store.setItems(n, arr)
298
293
  }
299
294
  if (syncConfig) {
@@ -321,10 +316,6 @@ export default (Store) => {
321
316
  up[type + 'SyncPassword'] = pass
322
317
  }
323
318
  store.updateSyncSetting(up)
324
- for (const u of toInsert) {
325
- await remove(u.name)
326
- await insert(u.name, u.value)
327
- }
328
319
  store.isSyncingSetting = false
329
320
  store.isSyncDownload = false
330
321
  }
@@ -389,7 +380,6 @@ export default (Store) => {
389
380
  .readFile(file.path)
390
381
  const { store } = window
391
382
  const objs = JSON.parse(txt)
392
- const toInsert = []
393
383
  const { names } = store.getDataSyncNames(true)
394
384
  for (const n of names) {
395
385
  let arr = objs[n]
@@ -398,16 +388,8 @@ export default (Store) => {
398
388
  } else if (n === settingMap.bookmarks) {
399
389
  arr = fixBookmarks(arr)
400
390
  }
401
- toInsert.push({
402
- name: n,
403
- value: arr
404
- })
405
391
  store.setItems(n, objs[n])
406
392
  }
407
- for (const u of toInsert) {
408
- await remove(u.name)
409
- await insert(u.name, u.value)
410
- }
411
393
  store.updateConfig(objs.config)
412
394
  store.setTheme(objs.config.theme)
413
395
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import createTitle from '../common/create-title'
6
6
  import { autoRun } from 'manate'
7
- import { update, remove, dbNamesForWatch } from '../common/db'
7
+ import { update, remove, insert, dbNamesForWatch } from '../common/db'
8
8
  import {
9
9
  sftpDefaultSortSettingKey,
10
10
  checkedKeysLsKey,
@@ -50,12 +50,9 @@ export default store => {
50
50
  for (const item of updated) {
51
51
  await update(item.id, item, name, false)
52
52
  }
53
- store.batchDbAdd(added.map(d => {
54
- return {
55
- db: name,
56
- obj: d
57
- }
58
- }))
53
+ for (const item of added) {
54
+ await insert(name, item)
55
+ }
59
56
  await update(
60
57
  `${name}:order`,
61
58
  (n || []).map(d => d.id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.60.48",
3
+ "version": "1.60.50",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",