Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/koni/dev/issue-295'…
Browse files Browse the repository at this point in the history
… into story-protocol-od-dev
  • Loading branch information
Thiendekaco committed Feb 7, 2025
2 parents 97795da + 616cbd9 commit 5d291b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/extension-koni-ui/src/Popup/AiAgent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -909,14 +909,14 @@ const Component = (props: Props): React.ReactElement => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [endStreamTrigger]);

const isLinkedAddress = !!wcAccount?.address && isSameAddress(wcAccount.address, addressLinked || '');
const isAddressLinked = !!wcAccount?.address && isSameAddress(wcAccount.address, addressLinked || '');

useEffect(() => {
if (aiTransactionInfo && aiTransactionInfo.type !== 'unknown' && !submitTxRef.current && startChat) {
clearCurrentAiTransactionInfo();

if (aiTransactionInfo.type === 'transfer') {
if (isLinkedAddress) {
if (isAddressLinked) {
onSubmitTransferTx(aiTransactionInfo).catch(console.error);
} else {
addPendingMessage({ message: 'Alright, let\'s first connect your wallet and then we can proceed with the transaction', type: 'apiMessage', appTriggeredAction: 'requestUserConnectWallet' });
Expand All @@ -926,14 +926,14 @@ const Component = (props: Props): React.ReactElement => {
onSubmitMintTx(aiTransactionInfo).catch(console.error);
}
}
}, [addPendingMessage, aiTransactionInfo, clearCurrentAiTransactionInfo, onSubmitMintTx, onSubmitTransferTx, startChat, isLinkedAddress]);
}, [addPendingMessage, aiTransactionInfo, clearCurrentAiTransactionInfo, onSubmitMintTx, onSubmitTransferTx, startChat, isAddressLinked]);

useEffect(() => {
if (isLinkedAddress && pendingTransferTransactionInfo) {
if (isAddressLinked && pendingTransferTransactionInfo) {
setPendingTransferTransactionInfo(undefined);
onSubmitTransferTx(pendingTransferTransactionInfo).catch(console.error);
}
}, [isLinkedAddress, onSubmitTransferTx, pendingTransferTransactionInfo]);
}, [isAddressLinked, onSubmitTransferTx, pendingTransferTransactionInfo]);

// if not loading and have pendingMessages, update messages to show
useEffect(() => {
Expand Down

0 comments on commit 5d291b7

Please sign in to comment.