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="space-y-4 py-9 h-full flex flex-col">
<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
:key="index"
:value="input.value"
@ -34,6 +34,7 @@
? input.tokenKeys
: activeStrategy.getContext()['tokenKeys']
"
:error="input.error"
:placeholder="input.placeholder()"
@input="$event => input.onInput($event)"
@tokenKeyChanged="

View File

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

View File

@ -54,6 +54,7 @@ export function useTenderly() {
const stopSimulation = async () => {
loading.value = true;
try {
if (forkId.value) {
await axios({
method: "delete",
url: `https://api.tenderly.co/api/v1/account/${$config.TENDERLY_FORK_PATH}/fork/${forkId.value}`,
@ -62,6 +63,7 @@ export function useTenderly() {
"Content-Type": "application/json"
}
});
}
} catch (error) {}
forkId.value = null;
@ -106,6 +108,6 @@ export function useTenderly() {
canSimulate,
startSimulation,
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 { SafeAppWeb3Modal } from "@gnosis.pm/safe-apps-web3modal";
import { Network } from "./useNetwork";
@ -134,10 +134,6 @@ export function useWeb3() {
web3.value = newWeb3;
};
watch(web3, () => {
window.web3 = web3.value;
});
return {
account,
chainId,

View File

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