Skip to content

Commit

Permalink
Disable SwapFooter when route === undefined (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao authored Feb 26, 2025
1 parent c981e6d commit c07aee3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-clocks-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@skip-go/widget": patch
---

disable swapfooter when route === undefined
4 changes: 2 additions & 2 deletions packages/widget/src/hooks/useSettingsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { useState } from "react";
export const useSettingsDrawer = () => {
const [drawerOpen, setDrawerOpen] = useState(false);
const shadowRoot = useAtomValue(shadowRootAtom);
const { isError: isRouteError } = useAtomValue(skipRouteAtom);
const { isError: isRouteError, data: route } = useAtomValue(skipRouteAtom);
const isWaitingForNewRoute = useAtomValue(isWaitingForNewRouteAtom);
const setShowGoFastErrorAtom = useSetAtom(goFastWarningAtom);

Expand All @@ -27,7 +27,7 @@ export const useSettingsDrawer = () => {

return (
<SwapPageFooter
disabled={isRouteError || isWaitingForNewRoute}
disabled={isRouteError || isWaitingForNewRoute || route === undefined}
showRouteInfo
showEstimatedTime
onClick={openSettingsDrawer}
Expand Down

0 comments on commit c07aee3

Please sign in to comment.