Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…plex into feature/ux-improvements
  • Loading branch information
kevdevg committed Oct 18, 2021
2 parents e00e679 + 65b421e commit e76efdf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/packages/cli/src/fair-launch-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2402,9 +2402,9 @@ program
console.log('Lottery results', sorted);

await Promise.all(
// each 8 entries is 1 byte, we want to send up 1000 bytes at a time.
// each 8 entries is 1 byte, we want to send up 10 bytes at a time.
// be specific here.
chunks(Array.from(Array(sorted.length).keys()), 8 * 1000).map(
chunks(Array.from(Array(sorted.length).keys()), 8 * 10).map(
async allIndexesInSlice => {
const bytes = [];
const correspondingArrayOfBits = [];
Expand Down
22 changes: 22 additions & 0 deletions js/packages/common/src/contexts/meta/meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@ export function MetaProvider({ children = null as any }) {
return nextState;
}

async function pullAllSiteData() {
if (isLoading) return state;
if (!storeAddress) {
if (isReady) {
setIsLoading(false);
}
return state;
} else if (!state.store) {
setIsLoading(true);
}
console.log('------->Query started');

const nextState = await loadAccounts(connection);

console.log('------->Query finished');

setState(nextState);
await updateMints(nextState.metadataByMint);
return;
}

async function update(
auctionAddress?: any,
bidderAddress?: any,
Expand Down Expand Up @@ -314,6 +335,7 @@ export function MetaProvider({ children = null as any }) {
pullAuctionPage,
pullAllMetadata,
pullBillingPage,
pullAllSiteData,
isLoading,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion js/packages/common/src/contexts/meta/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface MetaContextState extends MetaState {
];
pullAuctionPage: (auctionAddress: StringPublicKey) => Promise<MetaState>;
pullBillingPage: (auctionAddress: StringPublicKey) => void;

pullAllSiteData: () => void;
pullAllMetadata: () => void;
}

Expand Down
23 changes: 22 additions & 1 deletion js/packages/web/src/components/Notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export function useSettlementAuctions({
metadataByAuction,
undefined,
);
if (completeAuctionView) {
if(completeAuctionView) {
await settle(
connection,
wallet,
Expand Down Expand Up @@ -352,6 +352,7 @@ export function Notifications() {
store,
vaults,
safetyDepositBoxesByVaultAndIndex,
pullAllSiteData,
} = useMeta();
const possiblyBrokenAuctionManagerSetups = useAuctions(
AuctionViewState.Defective,
Expand Down Expand Up @@ -408,6 +409,26 @@ export function Notifications() {
});
});

notifications.push({
id: 'none',
title: 'Search for other auctions.',
description: (
<span>
Load all auctions (including defectives) by pressing here. Then you can
close them.
</span>
),
action: async () => {
try {
await pullAllSiteData();
} catch (e) {
console.error(e);
return false;
}
return true;
},
});

possiblyBrokenAuctionManagerSetups
.filter(v => v.auctionManager.authority === walletPubkey)
.forEach(v => {
Expand Down

0 comments on commit e76efdf

Please sign in to comment.