Skip to content

Commit 51e8b90

Browse files
authored
Merge pull request #298 from IntersectMBO/Fix-#2575-#3241
Changed wording for harwdare wallet
2 parents 7fe6078 + 5c79592 commit 51e8b90

File tree

2 files changed

+11
-9
lines changed
  • backend/src/api/proposal/controllers
  • pdf-ui/src/components/CreationGoveranceAction

2 files changed

+11
-9
lines changed

backend/src/api/proposal/controllers/proposal.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,11 @@ module.exports = createCoreController(
189189
if (!id) {
190190
return ctx.badRequest(null, "Proposal ID is required");
191191
}
192+
try {
193+
if(id.length !== 64) {
192194
// const sanitizedQueryParams = await this.sanitizeQuery(ctx);
193-
if (Number.isInteger(parseInt(id))) {
194-
proposal = await strapi.entityService.findOne(
195-
"api::proposal.proposal",
196-
id
197-
);
195+
proposal = await strapi.entityService.findOne(
196+
"api::proposal.proposal",id);
198197
} else {
199198
const proposalByHash = await strapi.entityService.findMany(
200199
"api::proposal-content.proposal-content",
@@ -206,14 +205,19 @@ module.exports = createCoreController(
206205
},
207206
}
208207
);
209-
let xid = parseInt(proposalByHash[0].proposal_id, 10);
210208
if (!proposalByHash) {
211209
return ctx.badRequest(null, "Proposal not found");
212210
}
211+
let xid = parseInt(proposalByHash[0].proposal_id, 10);
213212
proposal = await strapi.entityService.findOne(
214213
"api::proposal.proposal",
215214
xid
216215
);
216+
}
217+
218+
}
219+
catch (error) {
220+
return ctx.badRequest(null, "Proposal wit ID or Hash not found");
217221
}
218222
if (!proposal) {
219223
return ctx.badRequest(null, "Proposal not found");
@@ -228,7 +232,6 @@ module.exports = createCoreController(
228232
},
229233
},
230234
});
231-
232235
if (proposalContent?.data?.length > 0) {
233236
if (proposalContent?.data?.[0]?.attributes?.is_draft) {
234237
return ctx.badRequest(

pdf-ui/src/components/CreationGoveranceAction/Step1.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ const Step1 = ({ setStep, setProposalData, onClose, setSelectedDraftId }) => {
192192
gutterBottom
193193
sx={{ color: "#9c2224" }}
194194
>
195-
Our system has detected that you are using a hardware wallet which does not support the submission of governance actions.
196-
As a result, you will not be able to submit actions to the blockchain using this wallet.
195+
Please be aware that Ledger and Trezor hardware wallet do not support submission of governance actions, but you'll still be able to create the proposal.
197196
</Typography>
198197
</ListItem>
199198
</List>

0 commit comments

Comments
 (0)