Commentron: min tip API now uses float again

This commit is contained in:
infinite-persistence 2021-08-09 21:51:32 +08:00
parent e9a2f44899
commit 474da87c11
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 0 additions and 16 deletions

View file

@ -1429,15 +1429,6 @@ export const doUpdateCreatorSettings = (channelClaim: ChannelClaim, settings: Pe
return;
}
const BTC_SATOSHIS = 100000000;
if (settings.min_tip_amount_comment !== undefined) {
settings.min_tip_amount_comment *= BTC_SATOSHIS;
}
if (settings.min_tip_amount_super_chat !== undefined) {
settings.min_tip_amount_super_chat *= BTC_SATOSHIS;
}
return Comments.setting_update({
channel_name: channelClaim.name,
channel_id: channelClaim.claim_id,

View file

@ -4,8 +4,6 @@ import { handleActions } from 'util/redux-utils';
import { BLOCK_LEVEL } from 'constants/comment';
import { isURIEqual } from 'lbry-redux';
const BTC_SATOSHIS = 100000000;
const defaultState: CommentsState = {
commentById: {}, // commentId -> Comment
byId: {}, // ClaimID -> list of fetched comment IDs.
@ -1023,11 +1021,6 @@ export default handleActions(
}
}
// Both partial and full update will always include these,
// so safe to always re-compute without accidentally double-converting.
settingsByChannelId[channelId].min_tip_amount_comment /= BTC_SATOSHIS;
settingsByChannelId[channelId].min_tip_amount_super_chat /= BTC_SATOSHIS;
return {
...state,
settingsByChannelId,