Skip to content

Commit

Permalink
add ability to hide support button
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarebczan committed Oct 31, 2024
1 parent 8778025 commit 64b4300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# --- Minimum Version (Format: YYYYMMDDNNN) ---
# Bump this when we want to nudge the user to refresh.
MINIMUM_VERSION=20240429001
MINIMUM_VERSION=20241031001

# This is 'false' in the production instances:
IGNORE_MINIMUM_VERSION=true
Expand Down
9 changes: 8 additions & 1 deletion ui/component/claimSupportButton/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
import { getChannelIdFromClaim } from 'util/claim';
import ClaimSupportButton from './view';
import { selectPreferredCurrency } from 'redux/selectors/settings';
import { selectCanReceiveFiatTipsForUri } from 'redux/selectors/stripe';
import { doTipAccountCheckForUri } from 'redux/actions/stripe';

const DISABLE_SUPPORT_TAG = 'disable-support';
const DISABLED_SUPPORT = process.env.DISABLED_SUPPORT_CHANNELS ? process.env.DISABLED_SUPPORT_CHANNELS.split(',') : [];

const select = (state, props) => {
const { uri } = props;

const claim = selectClaimForUri(state, uri);
const isRepost = claim && claim.repost_url;
const channelClaimId = claim && getChannelIdFromClaim(claim);

const disableSupport =
makeSelectTagInClaimOrChannelForUri(uri, DISABLE_SUPPORT_TAG)(state) ||
(channelClaimId && DISABLED_SUPPORT.includes(channelClaimId));

return {
disableSupport: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_SUPPORT_TAG)(state),
disableSupport,
isRepost,
preferredCurrency: selectPreferredCurrency(state),
canReceiveFiatTips: selectCanReceiveFiatTipsForUri(state, uri),
Expand Down

0 comments on commit 64b4300

Please sign in to comment.