Skip to content

Commit

Permalink
HF 30 - Private groups - Fix donates
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Oct 21, 2024
1 parent 63cf192 commit 168ee08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/components/modules/Donate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ class Donate extends React.Component {
const { sym } = opts
if (sym === 'GOLOS') {
if (currentAccount) {
res = Asset(currentAccount.get('tip_balance'))
const tip = currentAccount.get('tip_balance')
if (tip) {
res = Asset(tip)
}
}
} else {
const uias = this.props.uias && this.props.uias.toJS()
if (uias) {
if (uias && uias[sym]) {
res = Asset(uias[sym].tip_balance)
}
}
Expand Down Expand Up @@ -110,6 +113,8 @@ class Donate extends React.Component {
const { sym } = opts
const { activeConfetti } = this.state

const balVal = this.balanceValue()

const form = (<Formik
initialValues={this.state.initialValues}
enableReinitialize={true}
Expand All @@ -128,11 +133,11 @@ class Donate extends React.Component {
amountStr={values.amount.amountStr}
onChange={amountStr => this.onPresetChange(amountStr, values, setFieldValue)}
/>
<TipAssetList
{balVal ? <TipAssetList
value={sym} uias={uias} currentAccount={currentAccount}
currentBalance={this.balanceValue()}
currentBalance={balVal}
onChange={this.onTipAssetChanged}
/>
/> : null}
</div>

<div className='row' style={{ marginTop: '1.0rem', marginBottom: '1.0rem' }}>
Expand Down
9 changes: 8 additions & 1 deletion src/utils/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,21 @@ const getRoleInGroup = (group, username) => {
const opGroup = (op) => {
let group = ''
if (!op) return group
const { extensions } = op
const { extensions, memo } = op
if (extensions) {
for (const ext of extensions) {
if (ext && ext[0] === 0) {
group = (ext[1] && ext[1].group) || group
}
}
}
if (group) return group
if (memo) { // donate
const { target } = memo
if (target && target.group) {
return target.group
}
}
return group
}

Expand Down

0 comments on commit 168ee08

Please sign in to comment.