fix: build errors

This commit is contained in:
bartosz-lipinski 2021-08-25 18:05:21 -05:00
parent c235f83571
commit 1e92387686
3 changed files with 18 additions and 17 deletions

View File

@ -113,7 +113,7 @@ export async function unwindVault(
nft.info.store,
vault.pubkey,
vault.info.fractionMint,
wallet.publicKey,
wallet.publicKey.toBase58(),
currInstructions,
);

View File

@ -1,4 +1,4 @@
import { useWallet } from '@oyster/common';
import { useWallet } from '@solana/wallet-adapter-react';
import { Col, Layout, Row, Tabs } from 'antd';
import BN from 'bn.js';
import React, { useMemo, useState } from 'react';
@ -26,7 +26,7 @@ export const AuctionListView = () => {
const auctionsEnded = useAuctions(AuctionViewState.Ended);
const [activeKey, setActiveKey] = useState(LiveAuctionViewState.All);
const { isLoading } = useMeta();
const { wallet, connected } = useWallet();
const { wallet, connected, publicKey } = useWallet();
const breakpointColumnsObj = {
default: 4,
1100: 3,
@ -81,7 +81,7 @@ export const AuctionListView = () => {
.filter(
(m, idx) =>
m.myBidderMetadata?.info.bidderPubkey ==
wallet?.publicKey?.toBase58(),
publicKey?.toBase58(),
);
break;
case LiveAuctionViewState.Resale:

View File

@ -1,4 +1,5 @@
import { useConnection, useStore, useWallet } from '@oyster/common';
import { useConnection, useStore, WalletSigner } from '@oyster/common';
import { useWallet } from '@solana/wallet-adapter-react';
import { Button } from 'antd';
import { useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
@ -6,6 +7,7 @@ import { saveAdmin } from '../../actions/saveAdmin';
import { useMeta } from '../../contexts';
import { WhitelistedCreator } from '../../models/metaplex';
import { SetupVariables } from '../../components/SetupVariables';
import { WalletAdapter } from '@solana/wallet-adapter-base';
export const SetupView = () => {
const [isInitalizingStore, setIsInitalizingStore] = useState(false);
@ -13,23 +15,23 @@ export const SetupView = () => {
const { store } = useMeta();
const { setStoreForOwner } = useStore();
const history = useHistory();
const { wallet, connected, connect } = useWallet();
const wallet = useWallet();
const [storeAddress, setStoreAddress] = useState<string | undefined>();
useEffect(() => {
const getStore = async () => {
if (connected && wallet) {
const store = await setStoreForOwner(wallet?.publicKey?.toBase58());
if (wallet.connected) {
const store = await setStoreForOwner(wallet.publicKey?.toBase58());
setStoreAddress(store);
} else {
setStoreAddress(undefined);
}
};
getStore();
}, [wallet?.publicKey, connected]);
}, [wallet.publicKey, wallet.connected]);
const initializeStore = async () => {
if (!wallet?.publicKey) {
if (!wallet.publicKey || !wallet) {
return;
}
@ -44,24 +46,23 @@ export const SetupView = () => {
// TODO: process errors
// Fack to reload meta
await setStoreForOwner(undefined);
await setStoreForOwner(wallet?.publicKey?.toBase58());
await setStoreForOwner(wallet.publicKey?.toBase58());
history.push('/admin');
};
return (
<>
{!connected && (
{!wallet.connected && (
<p>
<Button type="primary" className="app-btn" onClick={connect}>
<Button type="primary" className="app-btn" onClick={wallet.connect}>
Connect
</Button>{' '}
to configure store.
</p>
)}
{connected && !store && (
{wallet.connected && !store && (
<>
<p>Store is not initialized yet</p>
<p>There must be some SOL in the wallet before initialization.</p>
@ -82,7 +83,7 @@ export const SetupView = () => {
</p>
</>
)}
{connected && store && (
{wallet.connected && store && (
<>
<p>
To finish initialization please copy config below into{' '}
@ -90,7 +91,7 @@ export const SetupView = () => {
</p>
<SetupVariables
storeAddress={storeAddress}
storeOwnerAddress={wallet?.publicKey?.toBase58()}
storeOwnerAddress={wallet.publicKey?.toBase58()}
/>
</>
)}