Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/api/request/api-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const authList = [
'/discussion/new-comment',
'networkdao/contract/add',
'networkdao/contract/update',
'networkdao/vote/addTeamDesc',
...tmrwNeedAuthList,
...telegramNeedAuthList,
];
Expand Down
11 changes: 6 additions & 5 deletions src/app/network-dao/vote/KeyInTeamInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class KeyInTeamInfo extends PureComponent {
const { currentWallet } = this.props;

apiServer.get("/networkdao/vote/getTeamDesc", {
publicKey: currentWallet.publicKey,
publicKey: currentWallet.publicKey || localStorage.getItem('currentPublicKey'),
chainId: chain.chainId
})
.then((res) => {
Expand Down Expand Up @@ -385,17 +385,18 @@ class KeyInTeamInfo extends PureComponent {

console.log('currentWallet.address', currentWallet.address)

const _publicKey = publicKey || localStorage.getItem('currentPublicKey');
apiServer.post("/networkdao/vote/addTeamDesc", {
chainId: chain.chainId,
isActive: true,
publicKey,
publicKey: _publicKey,
address: currentWallet.address,
random: randomNum,
signature,
...submitValues,
}).then((res) => {
if (res.code === '2000') {
this.props.navigate(`/vote/team?pubkey=${publicKey}`);
if (res.code === '20000') {
this.props.navigate(`/vote/team?pubkey=${_publicKey}`);
} else {
toast.error(res.msg);
}
Expand Down Expand Up @@ -436,4 +437,4 @@ const KeyInTeamInfoConnect = connect(mapStateToProps)((KeyInTeamInfo));
export default function WrapKeyInTeamInfo(props) {
const router = useNetworkDaoRouter()
return <KeyInTeamInfoConnect {...props} navigate={router.push} />
}
}
4 changes: 3 additions & 1 deletion src/app/network-dao/vote/[path]/_page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ class VoteContainer extends Component {
}

async getCandidateInfo(currentWallet, electionContract) {
const { publicKey, address } = currentWallet;
const { publicKey: publicKeyFromWallet, address } = currentWallet;
const publicKeyLocal = localStorage.getItem('currentPublicKey');
const publicKey = publicKeyFromWallet || publicKeyLocal;
if (!publicKey && !address) {
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useGetToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const useGetToken = () => {
source = 'portkey';
}
}
localStorage.setItem('currentPublicKey', publicKey);
// ------------------------------------- request api -------------------------------------
const reqParams = {
grant_type: 'signature',
Expand Down