Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
Subx.autoRun(store, () => {
ls.set('sessions', copy(store.tabs).map(t => {
delete t.isTransporting
return t
}))
return store.tabs
})
Subx.autoRun(store, () => {
ls.set('bookmarks', store.bookmarks)
return store.bookmarks
})
Subx.autoRun(store, () => {
const themesObj = store.themes.reduce((p, k) => {
return {
...p,
[k.id]: k
}
}, {})
ls.set('themes', themesObj)
return store.themes
})
Subx.autoRun(store, () => {
ls.set('quickCommands', store.quickCommands)
return store.quickCommands
})
Subx.autoRun(store, () => {
} else if (tab === settingMap.quickCommands) {
return {
id: '',
name: q(newQuickCommand)
}
}
}
const tabs = [newTerm()]
const bookmarks = copy(ls.get(settingMap.bookmarks) || [])
const bookmarkGroups = copy(
ls.get(settingMap.bookmarkGroups) ||
getDefaultBookmarkGroups(bookmarks)
)
const store = Subx.create({
tabs,
height: 500,
width: window.innerWidth - sidebarWidth,
currentTabId: tabs[0].id,
history: copy(ls.get(settingMap.history) || []),
quickCommands: copy(ls.get(settingMap.quickCommands) || []),
quickCommandId: '',
bookmarks,
bookmarkGroups,
setting: [
{
id: 'setting-sync',
title: ss('settingSync')
}
],
sshConfigItems: copy(getGlobal('sshConfigItems')),
this.render = () => {
clearSubscription()
const { result, stream$ } = SubX.runAndMonitor(props.store, render)
this.__subscription__ = stream$.subscribe(event => {
if (event.type === 'STALE' && R.equals(R.path(event.path, props.store), event.cache)) {
return
}
clearSubscription()
this.forceUpdate()
})
return result
}
if (this.componentWillUnmount) {