Skip to content

Commit

Permalink
fix: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Oct 17, 2023
1 parent a6b9d47 commit add70d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/walletconnect/WcInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ReactElement } from 'react'

import { WalletConnectContext } from '@/services/walletconnect/WalletConnectContext'
import { asError } from '@/services/exceptions/utils'
import { getClipboard, isFirefox } from '@/utils/clipboard'
import { getClipboard, isPastingSupported } from '@/utils/clipboard'

import css from '../SessionList/styles.module.css'

Expand Down Expand Up @@ -62,7 +62,7 @@ const WcInput = ({ uri }: { uri: string }): ReactElement => {
label={error ? error.message : 'Pairing UI'}
placeholder="wc:"
InputProps={{
endAdornment: isFirefox() ? undefined : (
endAdornment: isPastingSupported() ? undefined : (
<InputAdornment position="end">
<Button variant="contained" onClick={onPaste} className={css.button}>
Paste
Expand Down
6 changes: 3 additions & 3 deletions src/utils/clipboard.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { logError, Errors } from '@/services/exceptions'

export const isFirefox = (): boolean => {
export const isPastingSupported = (): boolean => {
// 'clipboard-read' and `readText` are not supported by Firefox
// @see https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#browser_compatibility
return navigator.userAgent.includes('Firefox')
}

export const isClipboardGranted = async (): Promise<boolean> => {
if (isFirefox()) {
if (isPastingSupported()) {
return false
}

Expand All @@ -25,7 +25,7 @@ export const isClipboardGranted = async (): Promise<boolean> => {
}

export const getClipboard = async (): Promise<string> => {
if (isFirefox()) {
if (isPastingSupported()) {
return ''
}

Expand Down

0 comments on commit add70d1

Please sign in to comment.