Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): split button errors are not report…
Browse files Browse the repository at this point in the history
…ed to the user

Fixes #4876
  • Loading branch information
starpit committed Jun 12, 2020
1 parent 29c0e48 commit 49990cf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@
*/

import * as React from 'react'
import { i18n } from '@kui-shell/core'
import { i18n, pexecInCurrentTab } from '@kui-shell/core'

import Icons from '../../spi/Icons'
import KuiContext from '../context'
import onSplit from '../../../controller/split'

const strings = i18n('plugin-client-common')

/**
* re: the impl of the onClick handler, see
* https://github.com/IBM/kui/issues/4876
*
*/
export default class SplitTerminalButtonButton extends React.PureComponent {
public render() {
return (
Expand All @@ -36,7 +41,7 @@ export default class SplitTerminalButtonButton extends React.PureComponent {
aria-label="Split terminal"
tabIndex={0}
title={strings('Split the Terminal')}
onClick={() => onSplit()}
onClick={() => onSplit().catch(() => pexecInCurrentTab('split'))}
>
<Icons icon="Split" />
</a>
Expand Down

0 comments on commit 49990cf

Please sign in to comment.