RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/root/MainLayout/useIframeLogin.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { iframeLogin } from '../../../../app/ui-utils/client/lib/IframeLogin';
import { useReactiveValue } from '../../../hooks/useReactiveValue';

const pollIframeLoginUrl = (): string | undefined => {
    if (!iframeLogin.reactiveEnabled.get()) {
        return undefined;
    }

    return iframeLogin.reactiveIframeUrl.get();
};

export const useIframeLogin = (): string | undefined => useReactiveValue(pollIframeLoginUrl);