add further check for ability to expand.
Этот коммит содержится в:
@@ -16,6 +16,7 @@ import {STORAGE_KEY_EXPANSION_IN_PROGRESS} from 'components/self_hosted_expansio
|
||||
import SelfHostedExpansionModal from 'components/self_hosted_expansion_modal';
|
||||
|
||||
import {useControlModal, ControlModal} from './useControlModal';
|
||||
import useCanSelfHostedExpand from './useCanSelfHostedExpand';
|
||||
|
||||
interface HookOptions{
|
||||
onClick?: () => void;
|
||||
@@ -25,6 +26,7 @@ interface HookOptions{
|
||||
export default function useControlSelfHostedExpansionModal(options: HookOptions): ControlModal {
|
||||
const dispatch = useDispatch();
|
||||
const currentUser = useSelector(getCurrentUser);
|
||||
const canExpand = useCanSelfHostedExpand();
|
||||
const controlModal = useControlModal({
|
||||
modalId: ModalIdentifiers.SELF_HOSTED_EXPANSION,
|
||||
dialogType: SelfHostedExpansionModal,
|
||||
@@ -34,6 +36,10 @@ export default function useControlSelfHostedExpansionModal(options: HookOptions)
|
||||
return {
|
||||
...controlModal,
|
||||
open: async () => {
|
||||
if (!canExpand) {
|
||||
return;
|
||||
}
|
||||
|
||||
const purchaseInProgress = localStorage.getItem(STORAGE_KEY_EXPANSION_IN_PROGRESS) === 'true';
|
||||
|
||||
// check if user already has an open purchase modal in current browser.
|
||||
|
||||
Ссылка в новой задаче
Block a user