Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pop not opening bug fixed in build mode of bex #44

Open
wants to merge 7 commits into
base: Betho_playground
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,5 @@ electron-builder.yml

# Build folders for readthedocs
_build/
app/src-bex/www
app/src-bex/www
mozila_src/
6 changes: 6 additions & 0 deletions app/mozila/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin bash



yarn
yarn build-bex
39 changes: 39 additions & 0 deletions app/mozila/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Operating System
> windows 10
### Node
> v14.17.4
### Yarn
> v1.22.11

##How to test and run
You will have to use yarn as it won't work with npm
First run below command to install dependencies

(Note) if it says after installation
if it says gyp error please look at next line

> yarn

If you had gyp error othere wise you can ignore it and move to next command \
gyp ERR! stack at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\util.js:54:7\
gyp ERR! stack at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\util.js:33:16\
gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5)\
gyp ERR! stack at ChildProcess.emit (events.js:376:20)\
gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)\
gyp ERR! System Windows_NT 10.0.19042\
gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"rebuild\"\
gyp ERR! cwd\
gyp ERR! node -v v14.17.0\
gyp ERR! node-gyp -v v5.1.0\
gyp ERR! not ok"\
then you can ignore this error and continue to next command


Now run following command to get build
> yarn build-bex

Once it completes you will have dist directory in got to
>./dist/bex/UnPackaged

there you have build of extension you can load it in to browser and test

39 changes: 5 additions & 34 deletions app/quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,14 @@ module.exports = function (ctx) {
},
scopeHoisting: true,
vueRouterMode: 'history',
// vueCompiler: true,
// gzip: true,
// analyze: true,
extractCSS: true,
// transpile: true,
extendWebpack (cfg) {
console.log(cfg)
// cfg.plugins.push(
// new HtmlWebpackPlugin({
// template: `${__dirname}\\src\\index2.template.html`,
// filename: 'index3.html',
// chunks: 'all',
// ctx: ctx,
// process: { env: env },
// productName: 'PageTitle 3',
// productDescription: 'PageDescription 3',
// minify: true,
// hash: true
// })
// )
cfg.resolve.alias = {
...cfg.resolve.alias,
'@': path.resolve(__dirname, './src')
}
if (process.env.QMODE === 'bex' && cfg.mode === 'production') {
//
cfg.plugins.push(
new HtmlWebpackPlugin({
template: `${__dirname}/src-bex/background.template.html`,
Expand All @@ -170,23 +153,11 @@ module.exports = function (ctx) {
productName: 'Verto Background',
productDescription: 'Verto Background',
minify: false,
hash: false
hash: false,
})
)
cfg.optimization.splitChunks = {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'initial',
maxSize: 4000000
},
app: {
maxSize: 2000000
}
}
// chunks: ['app'],
// maxSize: 2000000
)
if (cfg.optimization.splitChunks){
cfg.optimization.splitChunks.cacheGroups.vendors.maxSize = 4000000
}
}

Expand Down
3 changes: 0 additions & 3 deletions app/src-bex/js/background-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import WalletConnect from '@walletconnect/client'
// import store from '@/store'
// More info: https://quasar.dev/quasar-cli/developing-browser-extensions/background-hooks
export default function attachBackgroundHooks (bridge /* , allActiveConnections */) {
console.log('idle setting')

const connect = async (connector, accounts) => {
connector.connected = false
connector._connected = false
Expand Down Expand Up @@ -162,5 +160,4 @@ export default function attachBackgroundHooks (bridge /* , allActiveConnections
url: chrome.runtime.getURL('www/index.html')
})
})
console.log('hooks')
}
6 changes: 6 additions & 0 deletions app/src-bex/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"description": "Verto is an extension for accessing blockchain enabled distributed applications, or Dapps in your normal Chrome or Firefox browser! ",
"version": "1.0.0",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
"strict_min_version": "55.0a2",
"id": "[email protected]"
}
},
"icons": {
"16": "icons/favicon-32x32.png",
"48": "icons/favicon-32x32.png",
Expand Down
4 changes: 0 additions & 4 deletions app/src/pages/Verto/StakeProxyEos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export default {
}

this.rewards = await this.getRewards()
console.log(this.rewards, 'his.rewards')
// look into checking current reward allocations
if (this.rewards && this.rewards.length) { this.rewards[0].value = 100 }

Expand Down Expand Up @@ -412,7 +411,6 @@ export default {
}
]
}
console.log(transactionObject, 'transactionObject', this.privateKey)
try {
this.step = 5
this.spinnervisible = true
Expand All @@ -432,7 +430,6 @@ export default {
let account = this.$store.state.currentwallet.wallet
account.privateKey = this.privateKey.key
this.sendFreeCPUTransaction(transactionObject.actions, account).then(result => {
console.log(result, 'result')
if (result.success) {
this.SuccessMessage = 'You have successfully unsigned up.'
} else {
Expand Down Expand Up @@ -536,7 +533,6 @@ export default {
this.spinnervisible = false
this.ErrorMessage = error.me

console.log(error, 'error')
if (error.toString().includes('is greater than the maximum billable CPU time for the transaction')) {
this.freeCPU = true
this.sendFreeCPUTransaction(transactionObject.actions)
Expand Down
1 change: 0 additions & 1 deletion app/src/pages/Verto/bex/Connect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export default {
}
},
async mounted () {
console.log(123)
this.setDefaultChoice()
/*
this.hasConfig = !!await configManager.hasVertoConfig()
Expand Down
2 changes: 0 additions & 2 deletions app/src/pages/Verto/bex/RestoreWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ export default {
try {
self.spinnervisible = true
const results = await configManager.restoreConfig(reader.result, self.addWallet.vertoPassword)
console.log(results, 'results restoreConfig')
if (results.message === 'bad_password') {
// self.startRestoreConfig()
self.spinnervisible = false
Expand All @@ -243,7 +242,6 @@ export default {
}, 300)
} catch (e) {
self.spinnervisible = false
console.log(e, 'restoreConfig error')
userError(e)
}
}
Expand Down
4 changes: 0 additions & 4 deletions app/src/pages/Verto/bex/StorageSync.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import configManager from '@/util/ConfigManager'
export default {
name: 'StorageSync',
async mounted () {
console.log('route loaded')
sessionStorage.setItem('router_loaded', true)
const routerLoaded = sessionStorage.getItem('app_started')
if (routerLoaded == null) {
Expand Down Expand Up @@ -47,7 +46,6 @@ export default {
const lastRoute = localStorage.getItem('last_route') ? JSON.parse(localStorage.getItem('last_route')) : null
console.log(lastRoute, 'lastRoute 2')
if (lastRoute && this.$route.name !== lastRoute.name && !['connectv1', 'storesync', 'login'].includes(lastRoute.name)) {
console.log('loading existing route ', lastRoute.path)
this.$router.push({
name: lastRoute.name,
query: lastRoute.query,
Expand All @@ -62,15 +60,13 @@ export default {
} else {
const hasConfig = !!await configManager.hasVertoConfig()
if (!hasConfig) {
console.log('moving to setup')
this.$router.push({
name: 'setup',
params: {
showConfigStep: true
}
})
} else {
console.log('moving to login')
this.$router.push({
name: 'login'
})
Expand Down
1 change: 0 additions & 1 deletion app/src/pages/Verto/bex/SyncWalletFromExtension.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export default {
try {
this.spinnervisible = true
const results = await configManager.restoreConfig(config, this.addWallet.vertoPassword)
console.log(results, 'results restoreConfig')
if (results.message === 'bad_password') {
this.spinnervisible = false
this.pwdError = true
Expand Down
1 change: 0 additions & 1 deletion app/src/router/_login.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ if (process.env.MODE === 'bex' || window.screen.width < 500) {
}
]
} else {
console.log('else route path')
shared_auth_urls = [
{
name: 'login',
Expand Down
3 changes: 0 additions & 3 deletions app/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => {
console.log(err, 'err')
if (err.name !== 'NavigationDuplicated') throw err
})
}
Expand All @@ -50,8 +49,6 @@ export default function (/* { store, ssrContext } */) {
Router.beforeEach((to, from, next) => {
const appStarted = sessionStorage.getItem('app_started')
const routerLoaded = sessionStorage.getItem('router_loaded')
const lastRoute = localStorage.getItem('last_route') ? JSON.parse(localStorage.getItem('last_route')) : null
console.log('navigating to route', to.name, lastRoute)
if (appStarted != null && routerLoaded != null && ['connectv1', 'receive'].includes(to.name)) {
const route = {
name: to.name,
Expand Down
2 changes: 1 addition & 1 deletion app/src/store/investment/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const getYvaultsPools = ({ rootState, commit, state }, payload) => {
pool.platform = 'yEarn'
pool.liquidity = parseInt(pool.liquidity)
pool.value = value.address
console.log(!(poolTokens.length > 1 && !pool.poolName.includes('/')))
// console.log(!(poolTokens.length > 1 && !pool.poolName.includes('/')))
// if (!(poolTokens.length > 1 && !pool.poolName.includes('/'))) {
commit('updatePools', pool)
// }
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/CrosschainDex.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class Crosschaindex {
// Print Ethereum transaction hash.
.on('transactionHash', (txHash) => depositLog(`Mint tx: ${txHash}`))
.on('tx_details', (tx_details) => {
console.log(tx_details, 'tx_details')
// console.log(tx_details, 'tx_details')
})
})
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/util/EosInterac.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class EosRPC {
return resp.rows
} catch (error) {
userError(error, 'Get table')
console.log(error, 'Get table')
// console.log(error, 'Get table')
throw error
}
}
Expand All @@ -89,7 +89,7 @@ class EosRPC {
return resp.rows
} catch (error) {
userError(error, 'Get table')
console.log(error, 'Get table')
// console.log(error, 'Get table')
throw error
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/util/ExternalWallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async getEthWalletData (wallet) {
let tokenSets = res.data.rebalancing_sets
if (ethplorer.tokens) {
ethplorer.tokens.filter(t => t.balance > 0 && t.tokenInfo.symbol).map(async (t, index) => {
const csa = Web3.utils.toChecksumAddress(t.tokenInfo.address)
let token = tokenSets.find(s => s.address.toLowerCase() === t.tokenInfo.address.toLowerCase())
t.tokenInfo.image = t.tokenInfo.image && t.tokenInfo.image.includes('https') ? t.tokenInfo.image : (token && token.image ? token.image : 'https://zapper.fi/images/' + t.tokenInfo.symbol.toUpperCase() + '-icon.png')
if (t.tokenInfo.image) {
Expand All @@ -136,7 +135,7 @@ async getEthWalletData (wallet) {
}
})
} catch (error) {
console.log('eth token not on 1inch', t.tokenInfo.image, csa, error)
// console.log('eth token not on 1inch', t.tokenInfo.image, csa, error)
}
}
let amount = (t.balance / (10 ** t.tokenInfo.decimals)) * t.tokenInfo.price.rate
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/Wallets2Tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Wallets2Tokens {
return
}
}

// console.log('walletName 3', data)
this.eos = new EosWrapper()
const self = this
self.eosUSD = 0
Expand Down
5 changes: 0 additions & 5 deletions app/src/util/bex/storeLoadedPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default function storeLoadedPlugin (store) {
const whitelist = ['vweReplaceState']
store.subscribe(async (mutation, state) => {
if (whitelist.includes(mutation.type)) {
console.log('state replaced')
sessionStorage.setItem('app_started', true)
const routerLoaded = sessionStorage.getItem('router_loaded')
if (routerLoaded == null) {
Expand All @@ -18,30 +17,26 @@ export default function storeLoadedPlugin (store) {
} else {
const lastRoute = localStorage.getItem('last_route') ? JSON.parse(localStorage.getItem('last_route')) : null
if (lastRoute && Router.currentRoute.name !== lastRoute.name && lastRoute.name !== 'storesync') {
console.log('loading existing route ', lastRoute.path)
Router.push({
name: lastRoute.name,
query: lastRoute.query,
params: lastRoute.params
})
} else {
if (state.currentwallet && state.currentwallet.loggedIn === true) {
console.log('moving to dashboard')
Router.push({
path: '/verto/dashboard'
})
} else {
const hasConfig = !!await configManager.hasVertoConfig()
if (!hasConfig) {
console.log('moving to setup')
Router.push({
name: 'setup',
params: {
showConfigStep: true
}
})
} else {
console.log('moving to login')
Router.push({
name: 'login'
})
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/walletlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Lib {
} else {
this.evms = evms
}
console.log(this.evms, ' this.evms')
// console.log(this.evms, ' this.evms')
}

async getRawETHTransaction (token, from, to, value, key, contract, origin = 'mnemonic', evm = 'eth') {
Expand Down