Clean up ether store
Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
@@ -19,7 +19,7 @@ const handleInputEvent = (event: any): void => {
|
||||
|
||||
tokenValue.value = Number(value);
|
||||
|
||||
if (decimalCount(tokenValue.value) > 2) {
|
||||
if (decimalCount(String(tokenValue.value)) > 2) {
|
||||
validDecimals.value = false;
|
||||
enableSelectButton.value = false;
|
||||
return;
|
||||
|
||||
@@ -35,7 +35,10 @@ const handleInputEvent = (event: any): void => {
|
||||
validDecimals.value = true;
|
||||
};
|
||||
|
||||
const handleButtonClick = async (offer: string, pixKey: string): Promise<void> => {
|
||||
const handleButtonClick = async (
|
||||
offer: string,
|
||||
pixKey: string
|
||||
): Promise<void> => {
|
||||
if (walletAddress.value) emit("approveTokens", { offer, pixKey });
|
||||
else await connectProvider();
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import polygonImage from "../assets/polygon.svg";
|
||||
// Store reference
|
||||
const etherStore = useEtherStore();
|
||||
|
||||
const { walletAddress, balance, sellerView } = storeToRefs(etherStore);
|
||||
const { walletAddress, sellerView } = storeToRefs(etherStore);
|
||||
|
||||
const menuOpenToggle = ref<boolean>(false);
|
||||
const menuHoverToggle = ref<boolean>(false);
|
||||
@@ -33,11 +33,6 @@ const formatWalletAddress = (): string => {
|
||||
return `${initialText}...${finalText}`;
|
||||
};
|
||||
|
||||
const formatWalletBalance = (): string => {
|
||||
const fixed = Number(balance.value);
|
||||
return fixed.toFixed(2);
|
||||
};
|
||||
|
||||
const disconnectUser = (): void => {
|
||||
etherStore.setWalletAddress("");
|
||||
closeMenu();
|
||||
|
||||
Reference in New Issue
Block a user