Web: Client: wait ready translations
This commit is contained in:
parent
437808b6bd
commit
4bb7ee25e8
@ -238,7 +238,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
});
|
||||
}, [socketHelper]);
|
||||
|
||||
const { t } = useTranslation(["Common", "SmartBanner"]);
|
||||
const { t, ready } = useTranslation(["Common", "SmartBanner"]);
|
||||
|
||||
let snackTimer = null;
|
||||
let fbInterval = null;
|
||||
@ -522,7 +522,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
<Layout>
|
||||
<Router history={history}>
|
||||
<>
|
||||
{isDocuments ? <ReactSmartBanner t={t} /> : <></>}
|
||||
{isDocuments ? <ReactSmartBanner t={t} ready={ready} /> : <></>}
|
||||
{isEditor ? <></> : <NavMenu />}
|
||||
<ScrollToTop />
|
||||
<Main isDesktop={isDesktop}>
|
||||
|
@ -9,7 +9,7 @@ const Wrapper = styled.div`
|
||||
`;
|
||||
|
||||
const ReactSmartBanner = (props) => {
|
||||
const { t } = props;
|
||||
const { t, ready } = props;
|
||||
const [isVisible, setIsVisible] = useState(true);
|
||||
const force = isIOS ? "ios" : "android";
|
||||
|
||||
@ -55,23 +55,22 @@ const ReactSmartBanner = (props) => {
|
||||
kindle: "kindle-fire-app",
|
||||
};
|
||||
|
||||
return (
|
||||
isMobile &&
|
||||
isVisible && (
|
||||
<Wrapper>
|
||||
<SmartBanner
|
||||
title={t("SmartBanner:AppName")}
|
||||
author="Ascensio System SIA"
|
||||
button={t("Common:View")}
|
||||
force={force}
|
||||
onClose={hideBanner}
|
||||
onInstall={hideBanner}
|
||||
storeText={storeText}
|
||||
price={priceText}
|
||||
appMeta={appMeta}
|
||||
/>
|
||||
</Wrapper>
|
||||
)
|
||||
return isMobile && isVisible && ready ? (
|
||||
<Wrapper>
|
||||
<SmartBanner
|
||||
title={t("SmartBanner:AppName")}
|
||||
author="Ascensio System SIA"
|
||||
button={t("Common:View")}
|
||||
force={force}
|
||||
onClose={hideBanner}
|
||||
onInstall={hideBanner}
|
||||
storeText={storeText}
|
||||
price={priceText}
|
||||
appMeta={appMeta}
|
||||
/>
|
||||
</Wrapper>
|
||||
) : (
|
||||
<></>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user