Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dcellar-web-ui): add debug point to test qa #384

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions apps/dcellar-web-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ const nextConfig = {
},
compiler: {
emotion: true,
removeConsole:
process.env.NODE_ENV === 'production'
? {
exclude: ['error', 'warn'],
}
: false,
// removeConsole:
// process.env.NODE_ENV === 'production'
// ? {
// exclude: ['error', 'warn'],
// }
// : false,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ export const OffChainAuthProvider: React.FC<any> = ({ children }) => {
}),
);

console.log('onOffChainAuth-pruneSps: ', pruneSps, authSps.current);
const configParam: IGenOffChainAuthKeyPairAndUpload = {
address,
chainId: GREENFIELD_CHAIN_ID,
sps: pruneSps,
domain,
expirationMs: EXPIRATION_MS,
};
console.log('onOffChainAuth-configParam: ', configParam);
const client = await getClient();
console.log('onOffChainAuth-client: ', client);
console.log('onOffchainAuth-provider:', provider);
const res = await client.offchainauth.genOffChainAuthKeyPairAndUpload(
configParam,
provider,
Expand Down
7 changes: 7 additions & 0 deletions apps/dcellar-web-ui/src/facade/sp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import axios from 'axios';
export const getStorageProviders = async (network?: 'mainnet') => {
const client = await getClient(network);
const [sps, error] = await client.sp.getStorageProviders().then(resolve, commonFault);

console.log(
'getStorageProviders-sps',
sps,
error,
(sps || []).filter((sp) => sp.endpoint.startsWith('https')),
);
return (sps || []).filter((sp) => sp.endpoint.startsWith('https'));
};

Expand Down
1 change: 1 addition & 0 deletions apps/dcellar-web-ui/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function DcellarApp({ Component, ...rest }: AppProps) {
DcellarApp.getInitialProps = wrapper.getInitialAppProps((store) => async (appCtx) => {
// todo refactor every page fetch policy
// only empty cache, then do fetch
console.log('DcellarApp.getInitialProps');
await store.dispatch(setupStorageProviders());
const nest = await App.getInitialProps(appCtx);

Expand Down
5 changes: 5 additions & 0 deletions apps/dcellar-web-ui/src/store/slices/sp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ export const setupStorageProviders = () => async (dispatch: AppDispatch, getStat
const { RECOMMEND_SPS } = getState().apollo;
if (_sps.length) return;

console.log('setupStorageProviders-_sps', _sps);
console.log('setupStorageProviders-unAvailableSps', unAvailableSps);
console.log('setupStorageProviders-RECOMMEND_SPS', RECOMMEND_SPS);

const sps = await getStorageProviders();
console.log('setupStorageProviders-sps', sps);
const recommend = (RECOMMEND_SPS || '')
.split(',')
.map((i: string) => i.trim())
Expand Down
Loading