Skip to content

Commit

Permalink
Merge pull request #106 from planetarium/bugfix
Browse files Browse the repository at this point in the history
Fix some bugs
  • Loading branch information
moreal authored Jul 1, 2024
2 parents 177a212 + 7f911aa commit 889cac9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
7 changes: 0 additions & 7 deletions background/src/api/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import axios from "axios";
import type { IStorage } from "../storage/index.js";
import {
CURRENT_NETWORK,
NETWORKS,
Network,
NetworkId,
} from "../constants/constants";
import { UnsignedTx } from "@planetarium/tx";
import { Buffer } from "buffer";
import { decode } from "@planetarium/bencodex";
import { Address, PublicKey } from "@planetarium/account";
import Decimal from "decimal.js";

async function getLastBlockIndex(endpoint: string) {
const response = await fetch(endpoint, {
Expand Down Expand Up @@ -76,7 +70,6 @@ export default class Graphql {
this.storage = storage;
this.endpoints = endpoints;
this.canCall = [
"updateNetwork",
"getLastBlockIndex",
"getBalance",
"getTransactionStatus",
Expand Down
4 changes: 2 additions & 2 deletions background/src/controllers/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ConnectionController {
async connect(origin: string, addresses: Address[]): Promise<void> {
const connections = await this.getConnections();
connections[origin] = addresses.map(x => x.toString());
await this.setConnnections(connections);
await this.setConnections(connections);
}

async isConnected(origin: string, address?: Address): Promise<boolean> {
Expand All @@ -29,7 +29,7 @@ export class ConnectionController {
return (await this.storage.get(CONNECTED_SITES)) || {};
}

private async setConnnections(connections: Connections) {
private async setConnections(connections: Connections) {
console.log("connections", connections);
await this.storage.set(CONNECTED_SITES, connections);
}
Expand Down
13 changes: 0 additions & 13 deletions background/src/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {
TXS,
ACCOUNTS,
Account,
Network,
NetworkId,
} from "../constants/constants";
import { RawPrivateKey } from "@planetarium/account";
import {
Expand All @@ -18,15 +16,7 @@ import {
} from "@planetarium/bencodex";
import * as ethers from "ethers";
import { Address } from "@planetarium/account";
import Decimal from "decimal.js";
import { UnsignedTx, encodeSignedTx, encodeUnsignedTx, signTx } from "@planetarium/tx";
import {
APPROVAL_REQUESTS,
CONNECTED_SITES,
CURRENT_NETWORK,
NETWORKS,
} from "../constants/constants";
import { nanoid } from "nanoid";
import { Lazyable, resolve } from "../utils/lazy";
import { Emitter } from "../event";
import { Buffer } from "buffer";
Expand Down Expand Up @@ -97,9 +87,6 @@ export default class Wallet {
"getPrivateKey",
"sign",
"signTx",
"getApprovalRequests",
"approveRequest",
"rejectRequest",
"listAccounts",
"getPublicKey",
"connect",
Expand Down
2 changes: 1 addition & 1 deletion popup/src/views/Confirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default defineComponent({
selectedAddresses: [],
};
},
beforeDestroy() {
beforeUnmount() {
if (this.refreshTimer) {
clearInterval(this.refreshTimer);
}
Expand Down
2 changes: 1 addition & 1 deletion popup/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default defineComponent({
refreshTimer: null,
};
},
beforeDestroy() {
beforeUnmount() {
if (this.refreshTimer) {
clearInterval(this.refreshTimer);
}
Expand Down

0 comments on commit 889cac9

Please sign in to comment.