Skip to content

Commit

Permalink
Removing confirmationToggle from next waas, must be set in config
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed May 1, 2024
1 parent c5ea938 commit 9dd625e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
32 changes: 0 additions & 32 deletions examples/next/src/app/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export const Connected = () => {
const [lastTxnDataHash, setLastTxnDataHash] = useState<string | undefined>()
const [lastTxnDataHash2, setLastTxnDataHash2] = useState<string | undefined>()

const [confirmationEnabled, setConfirmationEnabled] = useState<boolean>(localStorage.getItem('confirmationEnabled') === 'true')

const [pendingFeeOptionConfirmation, confirmPendingFeeOption, rejectPendingFeeOption] = useWaasFeeOptions()

const [selectedFeeOptionTokenName, setSelectedFeeOptionTokenName] = useState<string | undefined>()
Expand Down Expand Up @@ -404,36 +402,6 @@ export const Connected = () => {
</Box>
)}

{isWaasConnection && (
<Box marginY="3">
<Box as="label" flexDirection="row" alignItems="center" justifyContent="space-between">
<Text fontWeight="semibold" variant="small" color="text50">
Confirmations
</Text>

<Box alignItems="center" gap="2">
<Switch
name="confirmations"
checked={confirmationEnabled}
onCheckedChange={async (checked: boolean) => {
if (checked) {
localStorage.setItem('confirmationEnabled', 'true')
setConfirmationEnabled(true)
} else {
localStorage.removeItem('confirmationEnabled')
setConfirmationEnabled(false)
}

await delay(300)

window.location.reload()
}}
/>
</Box>
</Box>
</Box>
)}

<Box width="full" gap="2" flexDirection="row" justifyContent="flex-end">
<Button
onClick={() => {
Expand Down
5 changes: 3 additions & 2 deletions examples/next/src/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type ConnectionMode = 'waas' | 'universal'

export const connectionMode = 'waas' as ConnectionMode
export const isDebugMode = false
const enableConfirmationModal = false

const projectAccessKey = 'AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI'

Expand Down Expand Up @@ -44,8 +45,8 @@ const getWaasConnectors = () => {
appleClientId,
appleRedirectURI,
appName: 'Kit Demo',
projectAccessKey
// enableConfirmationModal: localStorage.getItem('confirmationEnabled') === 'true'
projectAccessKey,
enableConfirmationModal
}),
...(isDebugMode
? getKitConnectWallets(projectAccessKey, [
Expand Down
1 change: 0 additions & 1 deletion examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const connectionMode: ConnectionMode = searchParams.get('mode') === 'universal'

// append ?debug to url to enable debug mode
const isDebugMode = searchParams.has('debug')

const projectAccessKey = 'AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI'

const chains = [arbitrumNova, arbitrumSepolia, mainnet, polygon] as const satisfies Chain[]
Expand Down

0 comments on commit 9dd625e

Please sign in to comment.