Skip to content

Commit

Permalink
Merge pull request #96 from planetarium/remove-activate
Browse files Browse the repository at this point in the history
feat: remove activation part
  • Loading branch information
moreal authored Jun 19, 2024
2 parents b7d2da9 + c8fdf8c commit d518e71
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 49 deletions.
28 changes: 0 additions & 28 deletions background/src/api/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default class Graphql {
"updateNetwork",
"getLastBlockIndex",
"getBalance",
"getActivationStatus",
"getTransactionStatus",
"getNextTxNonce",
"getTransferAsset",
Expand Down Expand Up @@ -245,33 +244,6 @@ export default class Graphql {
});
}

async getActivationStatus(address: string): Promise<boolean> {
console.log("getActivationStatus", this.endpoints, address);
return this.callEndpoint(async (endpoint) => {
const response = await fetch(endpoint, {
method: "POST",
body: JSON.stringify({
variables: { address },
query: `
query getPledge($address: Address!) {
stateQuery {
pledge(agentAddress: $address) {
approved
}
}
}
`,
}),
headers: [
['content-type', 'application/json']
]
});
const data = await response.json();
console.log("getActivationStatus", data);
return data["data"]["stateQuery"]["pledge"]["approved"];
});
}

async getTransactionStatus({ txId, endpoint }) {
const response = await fetch(endpoint, {
method: "POST",
Expand Down
1 change: 0 additions & 1 deletion popup/src/components/AccountManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ interface Account {
index: number;
address: string;
primary?: boolean;
activated?: boolean;
imported?: boolean;
}
Expand Down
1 change: 0 additions & 1 deletion popup/src/components/buttons/AccountSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ interface Account {
index: number;
address: string;
primary?: boolean;
activated?: boolean;
imported?: boolean;
}
Expand Down
15 changes: 0 additions & 15 deletions popup/src/stores/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,6 @@ export const useAccounts = defineStore("Account", () => {

await bg.storage.set(ACCOUNTS, accounts.value);
}
async function checkAccountActivated(address: string) {
const found = accounts.value.find((a) =>
utils.equalsHex(a.address, address),
);
if (found) {
const activated = await bg.graphql<boolean>(
"getActivationStatus",
address,
);
found.activated = activated;
account.value = found;
}
}
async function refreshBalance(loading?: boolean) {
if (loading) {
balanceLoading.value = true;
Expand Down Expand Up @@ -258,7 +245,6 @@ export const useAccounts = defineStore("Account", () => {

await bg.storage.set(CURRENT_ADDRESS, address);

await checkAccountActivated(address);
await refreshBalance(true);
await loadTxs();
}
Expand Down Expand Up @@ -288,6 +274,5 @@ export const useAccounts = defineStore("Account", () => {
importAccount,
loadAccounts,
updateAccountName,
checkAccountActivated,
};
});
1 change: 0 additions & 1 deletion popup/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface Account {
index: number;
address: string;
primary?: boolean;
activated?: boolean;
imported?: boolean;
}

Expand Down
3 changes: 0 additions & 3 deletions popup/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

<div class="pt-12 mt-2 px-8">
<div><img src="@/assets/ncg_grey.png" width="64"/></div>
<div v-if="account && account.activated != true">
<v-chip size="small" label style="#555" class="mt-2" text-color="white">Inactive Account</v-chip>
</div>
<div class="mt-2">
<v-progress-circular indeterminate color="#555" width="3" size="30" v-if="balanceLoading"></v-progress-circular>
<div v-else class="d-flex ncg justify-center">
Expand Down

0 comments on commit d518e71

Please sign in to comment.