comments + contract update +
smaller design issues
This commit is contained in:
@@ -67,10 +67,8 @@
|
||||
import { ref, toRaw, onMounted, onUnmounted, getCurrentInstance } from "vue";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import Meme1Json from "@/assets/contracts/Meme1.json";
|
||||
import TokenNamePrice from "./TokenNamePrice.vue";
|
||||
import TokenLogo from "./TokenLogo.vue";
|
||||
import TokenInput from "./TokenInput.vue";
|
||||
import StakeComponentV1 from "@/components/StakeComponentV1.vue";
|
||||
|
||||
import { getAddressShortName, getblocky } from "@/helper/helper.js";
|
||||
@@ -83,21 +81,15 @@ const router = useRouter();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||
// const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||
|
||||
const fromAddress = ref(null);
|
||||
|
||||
const accountSub = ref(null);
|
||||
|
||||
const metaMaskInstalled = ref(false);
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
async function disconnectWallet() {
|
||||
console.log("disconnectWallet");
|
||||
try {
|
||||
instance.parent.emit("update:modelValue", false);
|
||||
await disconnect();
|
||||
// walletStore.connected = false;
|
||||
// walletStore.address = null;
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
}
|
||||
@@ -112,10 +104,12 @@ function isMetaMaskInstalled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
//go to the sacrifice-page and select the clicked token
|
||||
//if contract === bloodline show buy
|
||||
//we could also show buy, if there is no pepe
|
||||
function badgeClick(token) {
|
||||
var tokenData = tokenStore.getToken(token.contractAddress);
|
||||
tokenStore.activeToken = tokenData;
|
||||
// router.push({ name: "home", hash: `#${tokenData.name}` });
|
||||
if (tokenStore.memeToken.contractAddress === token.contractAddress) {
|
||||
//buy
|
||||
window.open(
|
||||
@@ -128,6 +122,7 @@ function badgeClick(token) {
|
||||
}
|
||||
}
|
||||
|
||||
//special case for metaMask, but I think that is the most used wallet
|
||||
async function connectWallet(connector) {
|
||||
if (connector.id === "metaMask" && !isMetaMaskInstalled()) {
|
||||
window.open(" https://metamask.io/", "_blank");
|
||||
@@ -136,10 +131,6 @@ async function connectWallet(connector) {
|
||||
instance.parent.emit("update:modelValue", false);
|
||||
await walletStore.connectWallet(toRaw(connector));
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
console.log("window.ethereum", window.ethereum);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
|
||||
Reference in New Issue
Block a user