From cd46baee875715652c465025d077cae59a922a34 Mon Sep 17 00:00:00 2001 From: "matvey20.18" Date: Mon, 7 Mar 2022 15:11:22 +0300 Subject: [PATCH] removed code and balance acc fixed --- frontend/src/nearConfig.js | 2 +- frontend/src/router/index.js | 36 ------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/frontend/src/nearConfig.js b/frontend/src/nearConfig.js index dca77ef..933f71e 100644 --- a/frontend/src/nearConfig.js +++ b/frontend/src/nearConfig.js @@ -16,7 +16,7 @@ export async function initContract() { // Getting the Account ID. If still unauthorized, it's just empty string window.accountId = window.walletConnection.getAccountId() - const acc = await near.account("near_testing.testnet") + const acc = await near.account(window.accountId) const balance = await acc.getAccountBalance() const amountInNEAR = utils.format.formatNearAmount(balance.total) window.balance = amountInNEAR diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 8af39d3..2f771b8 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -3,10 +3,6 @@ import Router from 'vue-router' import Home from '../views/Home' import ChooseNFT from "../views/ChooseNFT" import SendNFT from "../views/SendNFT" -// import ChooseEffect from "../views/ChooseEffect" -// import Minting from "../views/Minting" -// import WrapNFTS from "../views/WrapNFTS" -// import Unwrap from "../views/Unwrap" const { providers } = require("near-api-js") import store, { Status } from "../store" @@ -36,37 +32,8 @@ let routes = [ component: SendNFT, meta: { title: 'Do[NFT]', requiresAuth: true } }, -// { -// path: '/wrap', -// name: 'WrapNFTS', -// component: WrapNFTS, -// meta: { title: 'Do[NFT]' } -// }, -// { -// path: '/unwrap', -// name: 'Unwrap', -// component: Unwrap, -// meta: { title: 'Do[NFT]' } -// } ] -// if (process.env.VUE_APP_EFFECTS_ENABLED === 'true') { -// routes.push(...[ -// { -// path: '/choose_modification', -// name: 'ChooseEffect', -// component: ChooseEffect, -// meta: { title: 'Do[NFT]' } -// }, -// { -// path: '/mint', -// name: 'Minting', -// component: Minting, -// meta: { title: 'Do[NFT]' } -// }, -// ]) -// } - const router = new Router({ mode: 'history', base: process.env.BASE_URL, @@ -74,8 +41,6 @@ const router = new Router({ }) router.afterEach((to, from) => { - // Use next tick to handle router history correctly - // see: https://github.com/vuejs/vue-router/issues/914#issuecomment-384477609 Vue.nextTick(() => { from document.title = to.meta.title || process.env.NAME @@ -114,7 +79,6 @@ router.beforeEach((to, _from, next) => { } // handling transaction hashes, for displayng response to user - const account_id = window.accountId const url = new URL(document.location) const tx_hash = url.searchParams.get('transactionHashes')