{remainingImports() == 1
? __('This is your last import', 'extendify')
: sprintf(
__('You now have %s imports left', 'extendify'),
remainingImports(),
)}
tags
__(
"Subscribe and %1$swe'll send you 10 more%2$s. Plus you'll get updates and special offers from us fine folks at Extendify.",
'extendify',
),
'',
'',
),
),
}}>
)
}
const pass = () => {
const userState = useUserStore.getState()
const remainingImports = userState?.remainingImports()
// On the last import, show the modal if they opted out
if (remainingImports === 1 && userState?.registration?.optedOut) {
return false
}
return (
userState?.registration?.email?.length || // Already registered
userState?.apiKey?.length || // Already a member
userState?.registration?.optedOut || // Already opted out
userState?.imports === 0 // Hasn't imported yet
)
}
export function check() {
return {
id: 'NeedsRegistrationModal',
pass: pass(),
allow() {},
deny() {
return new Promise((resolve, reject) => {
useGlobalStore.setState({
currentModal: (
),
})
})
},
}
}