-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve sync deletion warnings (#3054)
* Make `selectHasYoutubeChannels` return `false` if account doesn't have YouTube channels * Add warning about synced channels do deletion modal * On channel deleiton, only show warning about sync deletion for accounts that have any synced channels. And make it look bit better * Put back accidentally deleted string --------- Co-authored-by: miko <[email protected]>
- Loading branch information
Showing
5 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { FormField } from 'component/common/form'; | |
|
||
type Props = { | ||
isPendingDeletion: ?boolean, | ||
hasYouTubeChannels: boolean, | ||
totalBalance: number, | ||
totalClaimsCount: number, | ||
isFetchingChannels: boolean, | ||
|
@@ -29,6 +30,7 @@ type Props = { | |
export default function ModalRemoveAccount(props: Props) { | ||
const { | ||
isPendingDeletion, | ||
hasYouTubeChannels, | ||
totalBalance, | ||
totalClaimsCount, | ||
isFetchingChannels, | ||
|
@@ -55,10 +57,7 @@ export default function ModalRemoveAccount(props: Props) { | |
const isLoadingAccountInfo = isFetchingChannels || isFetchingAccounts || isFetchingClaims; | ||
const isLoadingAccountInfoSuccess = isFetchingChannelsSuccess && isFetchingAccountsSuccess && isFetchingClaimsSuccess; | ||
const showButton = | ||
!buttonClicked && | ||
(!isPendingDeletion || !isWalletEmpty) && | ||
isLoadingAccountInfoSuccess && | ||
!isLoadingAccountInfo; | ||
!buttonClicked && (!isPendingDeletion || !isWalletEmpty) && isLoadingAccountInfoSuccess && !isLoadingAccountInfo; | ||
|
||
React.useEffect(() => { | ||
if (!isPendingDeletion || !isWalletEmpty) { | ||
|
@@ -155,6 +154,16 @@ export default function ModalRemoveAccount(props: Props) { | |
</p> | ||
</div> | ||
)} | ||
{showButton && hasYouTubeChannels && ( | ||
<div className="help--warning"> | ||
<p>{__('YOUTUBE SYNCED CHANNELS!')}</p> | ||
<p> | ||
{__( | ||
"If something went wrong with the sync, please don't try to fix it by deleting the channel. Instead reach out to us at [email protected] to get it fixed. Once deleted we may not be able to sync it again or fix it." | ||
)} | ||
</p> | ||
</div> | ||
)} | ||
<div className="section__actions"> | ||
{isBusy || isLoadingAccountInfo ? ( | ||
<BusyIndicator message={isBusy ? __('Removing content...') : __('Loading account info...')} /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,14 @@ type Props = { | |
abandonTxo: (Txo, () => void) => void, | ||
abandonClaim: (Claim, ?() => void) => void, | ||
tx: Txo, | ||
hasYouTubeChannels: boolean, | ||
claim: Claim, | ||
cb: () => void, | ||
doResolveUri: (string) => void, | ||
}; | ||
|
||
export default function ModalRevokeClaim(props: Props) { | ||
const { tx, claim, closeModal, abandonTxo, abandonClaim, cb, doResolveUri } = props; | ||
const { tx, hasYouTubeChannels, claim, closeModal, abandonTxo, abandonClaim, cb, doResolveUri } = props; | ||
const { value_type: valueType, type, normalized_name: name, is_my_input: isSupport } = tx || claim; | ||
const [channelName, setChannelName] = useState(''); | ||
|
||
|
@@ -73,12 +74,16 @@ export default function ModalRevokeClaim(props: Props) { | |
<p> | ||
{__('This will permanently remove your channel. Content published under this channel will be orphaned.')} | ||
</p> | ||
<p>{__('YOUTUBE SYNCED CHANNELS!')}</p> | ||
<p> | ||
{__( | ||
"If something went wrong with the sync, please don't try to fix it by deleting the channel. Instead reach out to us at [email protected] to get it fixed. Once deleted we may not be able to sync it again or fix it." | ||
)} | ||
</p> | ||
{hasYouTubeChannels && ( | ||
<div className="help--warning"> | ||
<p>{__('YOUTUBE SYNCED CHANNELS!')}</p> | ||
<p> | ||
{__( | ||
"If something went wrong with the sync, please don't try to fix it by deleting the channel. Instead reach out to us at [email protected] to get it fixed. Once deleted we may not be able to sync it again or fix it." | ||
)} | ||
</p> | ||
</div> | ||
)} | ||
<p>{__('Are you sure? Type %name% to confirm that you wish to remove the channel.', { name })}</p> | ||
<FormField type={'text'} onChange={(e) => setChannelName(e.target.value)} /> | ||
</React.Fragment> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters