Skip to content

Commit

Permalink
fix: tips for open position
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-path committed Nov 26, 2024
1 parent 6f3cdd5 commit b72c4ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions screens/Trading/components/ConfirmMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getAccountId } from "../../../redux/accountSelectors";
import { useRouterQuery } from "../../../utils/txhashContract";
import { handleTransactionHash } from "../../../services/transaction";
import { useToastMessage } from "../../../hooks/hooks";
import { showPositionClose, showPositionFailure } from "../../../components/HashResultModal";

const getTokenSymbolOnly = (assetId) => {
return assetId === "wNEAR" ? "NEAR" : assetId || "";
Expand Down Expand Up @@ -72,6 +73,11 @@ const ConfirmMobile = ({ open, onClose, action, confirmInfo }) => {
console.log(res);
} catch (error) {
console.log(error);
showPositionFailure({
title: "Open Position Failed",
errorMessage: JSON.stringify(error),
type: action,
});
} finally {
setIsDisabled(false);
onClose();
Expand All @@ -91,6 +97,11 @@ const ConfirmMobile = ({ open, onClose, action, confirmInfo }) => {
console.log(res);
} catch (error) {
console.log(error);
showPositionFailure({
title: "Open Position Failed",
errorMessage: JSON.stringify(error),
type: action,
});
} finally {
setIsDisabled(false);
onClose();
Expand Down
3 changes: 2 additions & 1 deletion store/marginActions/openPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@ export async function openPosition({
],
});

await prepareAndExecuteTransactions(transactions);
const result = await prepareAndExecuteTransactions(transactions);
return result;
}

0 comments on commit b72c4ce

Please sign in to comment.