Repository
https://github.com/steem-engine-exchange/nitrous/pull/51
Project Name: Nitrous
New Feature - Beneficiary info
PR: https://github.com/steem-engine-exchange/nitrous/pull/51
Show beneficiary info if exists
- only when
enable_comment_beneficiaries
is true - and beneficiary is not in
exclude_beneficiaries_accounts
e.g., finex, likwid
screenshot tested on local dev server for AAA. In my opinion, utopian.pay should also be added to
exclude_beneficiaries_accounts
globally :) But utopian will end soon anyway :(
when beneficiary (e.g., finex, likwid in AAA, SCT) is in
exclude_beneficiaries_accounts
, it should not be shown. also, the header 'beneficiaries' itself should not be shown.
The same posting on Busy (finex 100% is shown): https://busy.org/@blockchainstudio/scot-vp-viewer-vote-weight-multiplier-support
Code
- While some modification for styling id added, this is a basic code.
- For each beneficiary info, add it with hyperlink to the account.
Bug Fix - Tag order fix
PR: https://github.com/steem-engine-exchange/nitrous/pull/57
- introduce
MAX_TAG
andAPP_MAX_TAG
to avoid hardcoded max num of tags - fix tag order
Basically, we should use OrderedSet
instead of Set
.
This was much difficult to find than I initially thought, and that might be the reason why this bug had existed quite long.
It is because the standard JS library Set preserves the order, and immutable library Set also preserve the order up to 8 elements! Why up to 8!
Anyway, now the problem has been resolved.
Before
Trying to post with this order of tags on palnet.io
https://busy.org/@guest123/pob-is-dead
alphabetically ordered and palnet is inserted in a random position.
Another example.
palnet is inserted in 4th position (instead of 3rd position) which shows it's quite random.
https://busy.org/@guest123/3y2xik-test
After
previously tag order is tangled. https://busy.org/@guest123/j1tbe-test
fixed. You can also see duplicated tag is automatically removed, and
APP_NAME
is added to the last position if it's not added by users. https://busy.org/@guest123/tag-order-test
Code
- Previously 10 was hard-coded and therefore the previous contributor forgot to change some place.
- I first introduce
MAX_TAG
constant and use it throughout. - In fact, the last logic needs to be handled carefully, since
APP_NAME
tag is added if a user didn't include. So there should be a conditional check for this, which was also missing previously. (L973-4)
- And then, as explained, change from
Set
toOrderedSet
is needed.