check service config
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
|
import {useServiceConfigQuery} from '#/state/queries/email-verification-required'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {BSKY_SERVICE} from '../constants'
|
import {BSKY_SERVICE} from '../constants'
|
||||||
import {getHostnameFromUrl} from '../strings/url-helpers'
|
import {getHostnameFromUrl} from '../strings/url-helpers'
|
||||||
|
|
||||||
export function useEmail() {
|
export function useEmail() {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
|
||||||
|
const {data: serviceConfig} = useServiceConfigQuery()
|
||||||
|
|
||||||
const isSelfHost =
|
const isSelfHost =
|
||||||
|
serviceConfig?.checkEmailConfirmed &&
|
||||||
currentAccount &&
|
currentAccount &&
|
||||||
getHostnameFromUrl(currentAccount.service) !==
|
getHostnameFromUrl(currentAccount.service) !==
|
||||||
getHostnameFromUrl(BSKY_SERVICE)
|
getHostnameFromUrl(BSKY_SERVICE)
|
||||||
|
|||||||
Reference in New Issue
Block a user