diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-09 17:54:32 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-09 17:54:32 +0800 |
commit | 5868c91cfb54cfa9177572b201d88d1168bf5b06 (patch) | |
tree | 1471d8580a3b0bbba7a9fe0b70eac04de0ffcfe9 /packages/dev-tools-pages/ts/components/code.tsx | |
parent | fd034cc1e4475fa18cfa6a6afb79d09931189ecd (diff) | |
download | dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.gz dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.bz2 dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.lz dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.xz dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.zst dexon-sol-tools-5868c91cfb54cfa9177572b201d88d1168bf5b06.zip |
Fix static tests
Diffstat (limited to 'packages/dev-tools-pages/ts/components/code.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/code.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/dev-tools-pages/ts/components/code.tsx b/packages/dev-tools-pages/ts/components/code.tsx index dbd1a7e3c..71d7a7752 100644 --- a/packages/dev-tools-pages/ts/components/code.tsx +++ b/packages/dev-tools-pages/ts/components/code.tsx @@ -164,7 +164,7 @@ class Code extends React.Component<CodeProps, CodeState> { ) : null} </Base> {navigator.userAgent !== 'ReactSnap' && canCopy ? ( - <Button onClick={this._handleCopyAsync}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button> + <Button onClick={this._handleCopyAsync.bind(this)}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button> ) : null} </Container> ); @@ -182,7 +182,7 @@ class Code extends React.Component<CodeProps, CodeState> { }); } } - private readonly _handleCopyAsync = async () => { + private async _handleCopyAsync(): Promise<void> { try { if ('clipboard' in navigator) { await (navigator as any).clipboard.writeText(this.props.children); |