@electerm/electerm-react 2.16.6 → 2.16.9

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.
@@ -152,9 +152,9 @@ export default function QuickCommandsFooterBox (props) {
152
152
  return null
153
153
  }
154
154
  const all = props.currentQuickCommands
155
- if (!all.length) {
156
- return renderNoCmd()
157
- }
155
+ // if (!all.length) {
156
+ // return renderNoCmd()
157
+ // }
158
158
  const keyword0 = keyword.toLowerCase()
159
159
  const filtered = filterArray(all, keyword0, label)
160
160
  const sorted = qmSortByFrequency
@@ -226,6 +226,9 @@ export default function QuickCommandsFooterBox (props) {
226
226
  </Flex>
227
227
  <div className={cls}>
228
228
  {sorted.map(renderItem)}
229
+ {
230
+ !sorted.length && renderNoCmd()
231
+ }
229
232
  </div>
230
233
  </div>
231
234
  </div>
@@ -13,9 +13,6 @@ const SORT_BY_FREQ_KEY = 'electerm-history-sort-by-frequency'
13
13
 
14
14
  export default auto(function HistoryPanel (props) {
15
15
  const { store } = window
16
- if (store.config.disableConnectionHistory) {
17
- return null
18
- }
19
16
  const [sortByFrequency, setSortByFrequency] = useState(() => {
20
17
  return getItemJSON(SORT_BY_FREQ_KEY, false)
21
18
  })
@@ -27,7 +24,7 @@ export default auto(function HistoryPanel (props) {
27
24
  const {
28
25
  history
29
26
  } = store
30
- let arr = [...history]
27
+ let arr = store.config.disableConnectionHistory ? [] : history
31
28
  if (sortByFrequency) {
32
29
  arr = arr.sort((a, b) => { return b.count - a.count })
33
30
  }
@@ -215,7 +215,7 @@ export default class TerminalCmdSuggestions extends Component {
215
215
  history = [],
216
216
  batch = [],
217
217
  quick = []
218
- } = this.props.suggestions
218
+ } = this.props.suggestions || {}
219
219
  const res = []
220
220
  this.state.aiSuggestions
221
221
  .forEach(item => {
@@ -177,8 +177,8 @@ class Store {
177
177
  get terminalCommandSuggestions () {
178
178
  const { store } = window
179
179
  const historyCommands = Array.from(store.terminalCommandHistory.keys())
180
- const batchInputCommands = store.batchInputs
181
- const quickCommands = store.quickCommands.reduce(
180
+ const batchInputCommands = store.batchInputs || []
181
+ const quickCommands = (store.quickCommands || []).reduce(
182
182
  (p, q) => {
183
183
  return [
184
184
  ...p,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "2.16.6",
3
+ "version": "2.16.9",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",