Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/layouts/EnvoiLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const EnvoiLayout: React.FC<EnvoiLayoutProps> = ({ children }) => {
);
const [refreshTrigger, setRefreshTrigger] = useState(0);
const [paymentModalOpen, setPaymentModalOpen] = useState(false);
const [allowNonVoiPayments, setAllowNonVoiPayments] = useState(false);
Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowNonVoiPayments state is initialized but never updated, so the conditional block will never render. Hook this flag up to props, context, or a feature-flag service.

Copilot uses AI. Check for mistakes.

Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using local component state for a feature flag can lead to inconsistent behavior across the app; consider sourcing this flag from a centralized config or context.

Copilot uses AI. Check for mistakes.

const dispatch = useDispatch();
const paymentAssetSymbol = useSelector(
(state: RootState) => state.user.paymentMethod
Expand Down Expand Up @@ -1335,8 +1336,12 @@ const EnvoiLayout: React.FC<EnvoiLayoutProps> = ({ children }) => {
}}
>
<MenuItem value="VOI">VOI</MenuItem>
{/*<MenuItem value="aUSDC">aUSDC</MenuItem>*/}
<MenuItem value="UNIT">UNIT</MenuItem>
{allowNonVoiPayments && (
<>
<MenuItem value="aUSDC">aUSDC</MenuItem>
<MenuItem value="UNIT">UNIT</MenuItem>
</>
)}
</Select>
<Box
sx={{ display: "flex", justifyContent: "flex-end", gap: 1, mt: 3 }}
Expand Down