Skip to content

Commit

Permalink
Behavior changes on Send menu about resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffinPX committed Jul 22, 2024
1 parent 3214ce3 commit 6994707
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/pages/Wallet/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@ export default function SendDrawer () {
const { kaspa, request } = useKaspa()
const [ hash, params ] = useURLParams()
const [ outputs, setOutputs ] = useState<[ string, string ][]>([[ "", "" ]])

const [ transactions, setTransactions ] = useState<string[]>()
const [ error, setError ] = useState("")
const [ tab, setTab ] = useState(Tabs.Creation)

const initiateSend = useCallback(() => {
request('account:create', [ outputs, '0' ]).then((transactions) => {
if (hash !== 'send') {
setOutputs([[ "", "" ]])
}

setTransactions(transactions)
setTab(Tabs.Sign)
}).catch((err) => {
Expand All @@ -48,9 +43,13 @@ export default function SendDrawer () {

return (
<Sheet defaultOpen={hash === 'send'} onOpenChange={(open) => {
if (hash !== 'send' || open) return
if (open) return

window.close()
setOutputs([[ "", "" ]])

if (hash === 'send') {
window.close
}
}}>
<SheetTrigger asChild>
<Button className={"gap-2"}>
Expand All @@ -72,7 +71,7 @@ export default function SendDrawer () {
<div className="flex flex-row items-center">
<div className="flex flex-col">
<Carousel>
<CarouselContent className="w-56">
<CarouselContent className="w-60">
{outputs.map((output, id) => {
return (
<CarouselItem key={id} className={"flex flex-col gap-2.5 my-2"}>
Expand Down

0 comments on commit 6994707

Please sign in to comment.