Compare commits
4 Commits
fix/fix-ho
...
fix/disabl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aeed7c246 | ||
|
|
8d03edc299 | ||
|
|
4519906b78 | ||
|
|
88a47c49a4 |
@@ -249,6 +249,7 @@ export const AccountDialog = ({
|
|||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
outline
|
outline
|
||||||
|
disabled={activeAccount.isLoading}
|
||||||
css={{ mt: "$3", mr: "$1", ml: "auto" }}
|
css={{ mt: "$3", mr: "$1", ml: "auto" }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
deleteHook(activeAccount);
|
deleteHook(activeAccount);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export const deployHook = async (account: IAccount & { name?: string }, data: Se
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
console.log(filteredHookParameters)
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
const tx = {
|
const tx = {
|
||||||
Account: account.address,
|
Account: account.address,
|
||||||
@@ -153,13 +153,18 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
|
|||||||
if (!state.client) {
|
if (!state.client) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const currentAccount = state.accounts.find(
|
||||||
|
(acc) => acc.address === account.address
|
||||||
|
);
|
||||||
|
if (currentAccount?.isLoading || !currentAccount?.hooks.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
const tx = {
|
const tx = {
|
||||||
Account: account.address,
|
Account: account.address,
|
||||||
TransactionType: "SetHook",
|
TransactionType: "SetHook",
|
||||||
Sequence: account.sequence,
|
Sequence: account.sequence,
|
||||||
Fee: "1000000",
|
Fee: "100000",
|
||||||
Hooks: [
|
Hooks: [
|
||||||
{
|
{
|
||||||
Hook: {
|
Hook: {
|
||||||
@@ -172,9 +177,7 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
|
|||||||
|
|
||||||
const keypair = derive.familySeed(account.secret);
|
const keypair = derive.familySeed(account.secret);
|
||||||
const { signedTransaction } = sign(tx, keypair);
|
const { signedTransaction } = sign(tx, keypair);
|
||||||
const currentAccount = state.accounts.find(
|
|
||||||
(acc) => acc.address === account.address
|
|
||||||
);
|
|
||||||
if (currentAccount) {
|
if (currentAccount) {
|
||||||
currentAccount.isLoading = true;
|
currentAccount.isLoading = true;
|
||||||
}
|
}
|
||||||
@@ -196,6 +199,7 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: `[${submitRes.engine_result}] ${submitRes.engine_result_message} Validated ledger index: ${submitRes.validated_ledger_index}`,
|
message: `[${submitRes.engine_result}] ${submitRes.engine_result_message} Validated ledger index: ${submitRes.validated_ledger_index}`,
|
||||||
});
|
});
|
||||||
|
currentAccount.hooks = [];
|
||||||
} else {
|
} else {
|
||||||
toast.error(`${submitRes.engine_result_message || submitRes.error_exception}`, { id: toastId })
|
toast.error(`${submitRes.engine_result_message || submitRes.error_exception}`, { id: toastId })
|
||||||
state.deployLogs.push({
|
state.deployLogs.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user