From 99cb79e0cda5ee7040486910b56e7e3007f76a7f Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 8 Oct 2022 08:35:22 +0800 Subject: [PATCH] fix proposal content is nill --- src/libs/data/proposal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/data/proposal.js b/src/libs/data/proposal.js index 6b6c1242..a899ebb3 100644 --- a/src/libs/data/proposal.js +++ b/src/libs/data/proposal.js @@ -23,10 +23,6 @@ export default class Proposal { this.id = element.proposal_id || element.id this.status = element.status - this.type = element.content.type - if (element.content['@type']) { - this.type = element.content['@type'] - } this.tally = new ProposalTally().init(element.final_tally_result, total) this.submit_time = element.submit_time this.voting_end_time = element.voting_end_time @@ -37,6 +33,10 @@ export default class Proposal { if (this.contents) { this.title = this.contents.title this.description = this.contents.description + this.type = element.content.type + if (element.content['@type']) { + this.type = element.content['@type'] + } } return this }