Skip to content

Commit b6dde95

Browse files
Copilot0xrinegade
andcommitted
Fix wallet connection circular dependency error by removing duplicate AppContext and fixing Toast initialization order
Co-authored-by: 0xrinegade <[email protected]>
1 parent 9dbf175 commit b6dde95

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import './styles/guided-workflow.css';
77
import './styles/wallet-connection-guide.css';
88

99
// Import components
10-
import { AppContext } from './AppContext';
10+
import { AppContext } from './contexts/AppContext';
1111
import { NetworkSelector } from './components/NetworkSelector';
1212
import { OfferCreation } from './components/OfferCreation';
1313
import { OfferList } from './components/OfferList';

src/AppContext.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/ProgramDebugInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { AppContext } from '../AppContext';
2+
import { AppContext } from '../contexts/AppContext';
33
import { usePhantomWallet } from '../contexts/PhantomWalletProvider';
44

55
/**

src/components/Toast.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export const Toast = ({
2424
const [isVisible, setIsVisible] = useState(true);
2525
const [progress, setProgress] = useState(100);
2626

27+
const handleClose = useCallback(() => {
28+
setIsVisible(false);
29+
setTimeout(() => onClose?.(), 300); // Allow fade out animation
30+
}, [onClose]);
31+
2732
useEffect(() => {
2833
if (duration > 0) {
2934
const interval = setInterval(() => {
@@ -42,11 +47,6 @@ export const Toast = ({
4247
}
4348
}, [duration, handleClose]);
4449

45-
const handleClose = useCallback(() => {
46-
setIsVisible(false);
47-
setTimeout(() => onClose?.(), 300); // Allow fade out animation
48-
}, [onClose]);
49-
5050
const getToastIcon = () => {
5151
switch (type) {
5252
case 'success':

0 commit comments

Comments
 (0)