This commit is contained in:
Georges KABBOUCHI 2021-08-27 01:27:26 +03:00
parent ed3966b239
commit 2a4f366112
5 changed files with 21 additions and 18 deletions

View File

@ -24,7 +24,7 @@
<div class="mx-auto h-full" style="max-width: 296px"> <div class="mx-auto h-full" style="max-width: 296px">
<div class="space-y-4 py-9 h-full flex flex-col"> <div class="space-y-4 py-9 h-full flex flex-col">
<div class="flex-1"> <div class="flex-1">
<div v-for="(input, index) in inputs" :key="index"> <div v-for="(input, index) in inputs" :key="index" class="mb-6">
<input-amount <input-amount
:key="index" :key="index"
:value="input.value" :value="input.value"
@ -34,6 +34,7 @@
? input.tokenKeys ? input.tokenKeys
: activeStrategy.getContext()['tokenKeys'] : activeStrategy.getContext()['tokenKeys']
" "
:error="input.error"
:placeholder="input.placeholder()" :placeholder="input.placeholder()"
@input="$event => input.onInput($event)" @input="$event => input.onInput($event)"
@tokenKeyChanged=" @tokenKeyChanged="

View File

@ -45,7 +45,7 @@ export function useStrategy(defineStrategy: DefineStrategy) {
strategy.onUpdated(async () => { strategy.onUpdated(async () => {
await nextTick(); await nextTick();
inputs.value = strategy.inputs; // inputs.value = strategy.inputs;
console.log("onUpdated"); console.log("onUpdated");
}); });
@ -66,8 +66,6 @@ export function useStrategy(defineStrategy: DefineStrategy) {
showPendingTransaction(tx); showPendingTransaction(tx);
close(); close();
} catch (e) { } catch (e) {
console.error(e);
error.value = e.message; error.value = e.message;
} }
pending.value = false; pending.value = false;

View File

@ -54,14 +54,16 @@ export function useTenderly() {
const stopSimulation = async () => { const stopSimulation = async () => {
loading.value = true; loading.value = true;
try { try {
await axios({ if (forkId.value) {
method: "delete", await axios({
url: `https://api.tenderly.co/api/v1/account/${$config.TENDERLY_FORK_PATH}/fork/${forkId.value}`, method: "delete",
headers: { url: `https://api.tenderly.co/api/v1/account/${$config.TENDERLY_FORK_PATH}/fork/${forkId.value}`,
"X-Access-key": $config.TENDERLY_KEY, headers: {
"Content-Type": "application/json" "X-Access-key": $config.TENDERLY_KEY,
} "Content-Type": "application/json"
}); }
});
}
} catch (error) {} } catch (error) {}
forkId.value = null; forkId.value = null;
@ -106,6 +108,6 @@ export function useTenderly() {
canSimulate, canSimulate,
startSimulation, startSimulation,
stopSimulation, stopSimulation,
loading, loading
}; };
} }

View File

@ -1,4 +1,4 @@
import { computed, onMounted, ref, watch } from "@nuxtjs/composition-api"; import { computed, onMounted, ref } from "@nuxtjs/composition-api";
import Web3 from "web3"; import Web3 from "web3";
import { SafeAppWeb3Modal } from "@gnosis.pm/safe-apps-web3modal"; import { SafeAppWeb3Modal } from "@gnosis.pm/safe-apps-web3modal";
import { Network } from "./useNetwork"; import { Network } from "./useNetwork";
@ -134,10 +134,6 @@ export function useWeb3() {
web3.value = newWeb3; web3.value = newWeb3;
}; };
watch(web3, () => {
window.web3 = web3.value;
});
return { return {
account, account,
chainId, chainId,

View File

@ -49,7 +49,13 @@ export class Strategy {
continue; continue;
} }
if(input.defaulted){
continue;
}
Object.assign(input, input.defaults(this.getBaseContext())); Object.assign(input, input.defaults(this.getBaseContext()));
input.defaulted = true;
} }
this.notifyListeners(); this.notifyListeners();