Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ export function AppWrapper({ children }) {
const init = async () => {
if (ipfs) return;

const ipfsNodeLocal = localStorage.getItem('ipfsNode') || null;
if (ipfsNodeLocal) {
setIpfs(ipfsNodeLocal);
return;
}

const node = await create();
if (node) {
localStorage.setItem('ipfsNode', node);
}

const nodeId = await node.id();
const nodeVersion = await node.version();
Expand Down