Skip to content

Commit

Permalink
fix amber and serial port signers
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Nov 18, 2024
1 parent 1fa3e65 commit 1461511
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
3 changes: 2 additions & 1 deletion src/classes/accounts/amber-account.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AmberClipboardSigner } from "applesauce-signer";
import { AmberClipboardSigner } from "applesauce-signer/signers/amber-clipboard-signer";
import { Account } from "./account";

export default class AmberAccount extends Account {
Expand All @@ -15,5 +15,6 @@ export default class AmberAccount extends Account {
constructor(pubkey: string) {
super(pubkey);
this.signer = new AmberClipboardSigner();
this.signer.pubkey = pubkey;
}
}
3 changes: 2 additions & 1 deletion src/classes/accounts/serial-port-account.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SerialPortSigner } from "applesauce-signer";
import { SerialPortSigner } from "applesauce-signer/signers/serial-port-signer";
import { Account } from "./account";

export default class SerialPortAccount extends Account {
Expand All @@ -14,5 +14,6 @@ export default class SerialPortAccount extends Account {
constructor(pubkey: string) {
super(pubkey);
this.signer = new SerialPortSigner();
this.signer.pubkey = pubkey;
}
}
8 changes: 0 additions & 8 deletions src/services/amber-signer.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/services/serial-port.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/views/signin/start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import UsbFlashDrive from "../../components/icons/usb-flash-drive";
import HelpCircle from "../../components/icons/help-circle";

import accountService from "../../services/account";
import serialPortService from "../../services/serial-port";
import amberSignerService from "../../services/amber-signer";
import { AtIcon } from "../../components/icons";
import Package from "../../components/icons/package";
import Eye from "../../components/icons/eye";
Expand Down Expand Up @@ -47,7 +45,8 @@ export default function LoginStartView() {
try {
setLoading(true);

const pubkey = await serialPortService.getPublicKey();
const signer = new SerialPortSigner();
const pubkey = await signer.getPublicKey();
accountService.addAccount(new SerialPortAccount(pubkey));
accountService.switchAccount(pubkey);
} catch (e) {
Expand All @@ -61,7 +60,8 @@ export default function LoginStartView() {

const signinWithAmber = async () => {
try {
const pubkey = await amberSignerService.getPublicKey();
const signer = new AmberClipboardSigner();
const pubkey = await signer.getPublicKey();
accountService.addAccount(new AmberAccount(pubkey));
accountService.switchAccount(pubkey);
} catch (e) {
Expand Down

0 comments on commit 1461511

Please sign in to comment.