Explorar el Código

20230222: Started to check validator & nominator chain queries

mkbeefcake hace 1 año
padre
commit
5936eacec9

+ 4 - 2
src/App.tsx

@@ -257,6 +257,8 @@ class App extends React.Component<IProps, IState> {
     ApiPromise.create({ provider/*, types*/ }).then(async (api) => {
     ApiPromise.create({ provider/*, types*/ }).then(async (api) => {
       await api.isReady;
       await api.isReady;
       console.log(`Connected to ${wsLocation}`);
       console.log(`Connected to ${wsLocation}`);
+      debugger;
+      
       this.setState({ connected: true });
       this.setState({ connected: true });
       this.updateWorkingGroups(api);
       this.updateWorkingGroups(api);
 
 
@@ -317,8 +319,8 @@ class App extends React.Component<IProps, IState> {
   }
   }
 
 
   componentDidMount() {
   componentDidMount() {
-    // this.loadData(); // local storage + bootstrap
-    // this.joyApi(); // joystream rpc connection
+    this.loadData(); // local storage + bootstrap
+    this.joyApi(); // joystream rpc connection
     //this.initializeSocket() // jsstats socket.io
     //this.initializeSocket() // jsstats socket.io
   }
   }
 
 

+ 3 - 3
src/components/Dashboard/Proposals.tsx

@@ -25,7 +25,7 @@ const ProposalWorker = (props: {proposal: Proposal} ) => {
 	const { proposal } = props;
 	const { proposal } = props;
 
 
 	return (
 	return (
-		<TableRow key={proposal.id}>
+		<TableRow key={`key-${proposal.id}`}>
 			<TableCell>{proposal.title}</TableCell>
 			<TableCell>{proposal.title}</TableCell>
 			<TableCell><i>{proposal.createdAt}</i></TableCell>
 			<TableCell><i>{proposal.createdAt}</i></TableCell>
 			<TableCell>
 			<TableCell>
@@ -78,8 +78,8 @@ const Proposals = (props: { council: ElectedCouncil | undefined}) => {
 								<TableBody>
 								<TableBody>
 									{rowsPerPage > 0 ? 
 									{rowsPerPage > 0 ? 
 											proposals.slice(page * rowsPerPage, page *rowsPerPage + rowsPerPage)
 											proposals.slice(page * rowsPerPage, page *rowsPerPage + rowsPerPage)
-												.map((proposal) => <ProposalWorker proposal={proposal}/>)
-										: proposals.map((proposal) => <ProposalWorker proposal={proposal} />)
+												.map((proposal) => <ProposalWorker key={proposal.id} proposal={proposal}/>)
+										: proposals.map((proposal) => <ProposalWorker key={proposal.id} proposal={proposal} />)
 									}
 									}
 								</TableBody>
 								</TableBody>
 							</>)}
 							</>)}

+ 1 - 1
src/components/Dashboard/index.tsx

@@ -7,7 +7,7 @@ import Videos from "./Videos";
 import Forum from "./Forum";
 import Forum from "./Forum";
 import Election from "./Election";
 import Election from "./Election";
 import Validation from "./Validation";
 import Validation from "./Validation";
-import WorkGroup from './WorkGroup';
+import WorkGroup from './Workgroup';
 
 
 import Banner from "./ui/Banner";
 import Banner from "./ui/Banner";
 import { useElectedCouncils } from '@/hooks';
 import { useElectedCouncils } from '@/hooks';

+ 0 - 1
src/lib/queries.ts

@@ -12,7 +12,6 @@ export const queryJstats = (route: string) => {
 };
 };
 
 
 export const getTokenomics = async (old?: Tokenomics) => {
 export const getTokenomics = async (old?: Tokenomics) => {
-  debugger;
   if (old?.timestamp + 300000 > new Date()) return;
   if (old?.timestamp + 300000 > new Date()) return;
   console.debug(`Updating tokenomics`);
   console.debug(`Updating tokenomics`);
   let { data } = await axios.get("https://status.joystream.org/status");
   let { data } = await axios.get("https://status.joystream.org/status");