Skip to content

Commit b701265

Browse files
committed
fix flow breaking release
1 parent 3aae5d0 commit b701265

File tree

2 files changed

+19
-38
lines changed

2 files changed

+19
-38
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"@magic-ext/flow": "3.1.0",
7-
"@onflow/fcl": "0.0.37",
7+
"@onflow/fcl": "1.0.2",
88
"@onflow/types": "0.0.3",
99
"@testing-library/jest-dom": "^4.2.4",
1010
"@testing-library/react": "^9.3.2",
@@ -38,4 +38,4 @@
3838
"last 1 safari version"
3939
]
4040
}
41-
}
41+
}

src/App.js

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
import React, { useState, useEffect } from "react";
22
import * as fcl from "@onflow/fcl";
3-
import {Magic} from 'magic-sdk';
4-
import { FlowExtension } from '@magic-ext/flow';
3+
import { Magic } from "magic-sdk";
4+
import { FlowExtension } from "@magic-ext/flow";
55
import "./styles.css";
66

7-
87
// CONFIGURE ACCESS NODE
9-
fcl.config().put("accessNode.api", "https://access-testnet.onflow.org");
8+
fcl.config().put("accessNode.api", "https://rest-testnet.onflow.org");
109

11-
// CONFIGURE WALLET
12-
// replace with your own wallets configuration
13-
// Below is the local environment configuration for the dev-wallet
14-
fcl
15-
.config()
16-
.put("challenge.handshake", "http://access-001.devnet9.nodes.onflow.org:8000");
1710

1811

19-
const magic = new Magic('pk_live_06D5F65BB9CDD2F0', {
12+
const magic = new Magic("pk_live_06D5F65BB9CDD2F0", {
2013
extensions: [
2114
new FlowExtension({
22-
rpcUrl: 'https://access-testnet.onflow.org',
23-
network: 'testnet'
15+
rpcUrl: "https://rest-testnet.onflow.org",
16+
network: "testnet"
2417
})
2518
]
2619
});
@@ -30,7 +23,6 @@ const magic = new Magic('pk_live_06D5F65BB9CDD2F0', {
3023
// const AUTHORIZATION_FUNCTION = fcl.currentUser().authorization;
3124
const AUTHORIZATION_FUNCTION = magic.flow.authorization;
3225

33-
3426
export default function App() {
3527
const [email, setEmail] = useState("");
3628
const [isLoggedIn, setIsLoggedIn] = useState(false);
@@ -40,7 +32,7 @@ export default function App() {
4032
const [message, setMessage] = useState("");
4133

4234
useEffect(() => {
43-
magic.user.isLoggedIn().then(async magicIsLoggedIn => {
35+
magic.user.isLoggedIn().then(async (magicIsLoggedIn) => {
4436
setIsLoggedIn(magicIsLoggedIn);
4537
if (magicIsLoggedIn) {
4638
const { publicAddress } = await magic.user.getMetadata();
@@ -61,14 +53,7 @@ export default function App() {
6153
};
6254

6355
const verify = async () => {
64-
6556
try {
66-
const getReferenceBlock = async () => {
67-
const response = await fcl.send([fcl.getLatestBlock()])
68-
const data = await fcl.decode(response)
69-
return data.id
70-
}
71-
7257

7358
console.log("SENDING TRANSACTION");
7459
setVerifying(true);
@@ -86,10 +71,10 @@ export default function App() {
8671
}
8772
}
8873
`,
89-
fcl.ref(await getReferenceBlock()),
9074
fcl.proposer(AUTHORIZATION_FUNCTION),
9175
fcl.authorizations([AUTHORIZATION_FUNCTION]),
92-
fcl.payer(AUTHORIZATION_FUNCTION)
76+
fcl.payer(AUTHORIZATION_FUNCTION),
77+
fcl.limit(9999)
9378
]);
9479
console.log("TRANSACTION SENT");
9580
console.log("TRANSACTION RESPONSE", response);
@@ -119,7 +104,7 @@ export default function App() {
119104
name="email"
120105
required="required"
121106
placeholder="Enter your email"
122-
onChange={event => {
107+
onChange={(event) => {
123108
setEmail(event.target.value);
124109
}}
125110
/>
@@ -135,21 +120,17 @@ export default function App() {
135120
</div>
136121
<div className="container">
137122
<h1>Flow address</h1>
138-
<div className="info">
139-
{publicAddress}
140-
</div>
123+
<div className="info">{publicAddress}</div>
141124
</div>
142125
<div className="container">
143126
<h1>Verify Transaction</h1>
144-
{
145-
verifying ? <div className="sending-status">
146-
Verifying Transaction
147-
</div> : ''
148-
}
127+
{verifying ? (
128+
<div className="sending-status">Verifying Transaction</div>
129+
) : (
130+
""
131+
)}
149132
<div className="info">
150-
<div>
151-
{message}
152-
</div>
133+
<div>{message}</div>
153134
</div>
154135
<button id="btn-deploy" onClick={verify}>
155136
Verify

0 commit comments

Comments
 (0)