persist active tab but force people to boost tab if it's on their own upload

This commit is contained in:
Anthony 2021-09-07 22:43:25 +02:00
parent a07146ffc1
commit 7b0cde601f
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -83,8 +83,15 @@ function WalletSendTip(props: Props) {
const [tipError, setTipError] = React.useState();
// denote which tab to show on the frontend
const [activeTab, setActiveTab] = React.useState(TAB_BOOST);
const [activeTab, setActiveTab] = usePersistedState(TAB_BOOST);
// force to boost tab if it's someone's own upload
React.useEffect(() => {
if (claimIsMine) {
setActiveTab(TAB_BOOST);
}
}, []);
// alphanumeric claim id
const { claim_id: claimId } = claim;
@ -94,7 +101,7 @@ function WalletSendTip(props: Props) {
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id;
// setup variables for tip API
// setup variables for backend tip API
let channelClaimId, tipChannelName;
// if there is a signing channel it's on a file
if (claim.signing_channel) {