Skip to content

Commit c5bf46d

Browse files
committed
connect: hide Connect UI
1 parent cfcacbe commit c5bf46d

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

app/src/components/connect/ConnectPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import { Redirect } from 'react-router';
23
import { observer } from 'mobx-react-lite';
34
import styled from '@emotion/styled';
45
import nodeConnectSvg from 'assets/images/lightning-node-connect.svg';
@@ -32,7 +33,11 @@ const Styled = {
3233

3334
const ConnectPage: React.FC = () => {
3435
const { l } = usePrefixedTranslation('cmps.connect.ConnectPage');
35-
const { sessionStore } = useStore();
36+
const { appView, sessionStore } = useStore();
37+
38+
if (!appView.showLightningConnect) {
39+
return <Redirect to="/loop" />;
40+
}
3641

3742
const { Wrapper, DisplayLarge, Description, Divider } = Styled;
3843
return !sessionStore.hasMultiple ? (

app/src/components/layout/NavMenu.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ const NavMenu: React.FC = () => {
8484
<NavItem page="history" onClick={appView.goToHistory} />
8585
<NavItem page="pool" badge={l('common.preview')} onClick={appView.goToPool} />
8686
<NavItem page="settings" onClick={appView.goToSettings} />
87-
<NavItem page="connect" badge={l('common.beta')} onClick={appView.goToConnect} />
87+
{appView.showLightningConnect && (
88+
<NavItem
89+
page="connect"
90+
badge={l('common.beta')}
91+
onClick={appView.goToConnect}
92+
/>
93+
)}
8894
</Nav>
8995
</>
9096
);

app/src/store/views/appView.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export default class AppView {
3939
}
4040
}
4141

42+
/** determines if the Lightning Node Connect UI should be visible */
43+
get showLightningConnect() {
44+
const devOverride = !!localStorage.getItem('i-want-lnc');
45+
/** the unix timestamp (ms) when Lightning Node Connect should become visible */
46+
return devOverride || Date.now() > 1638288000000; // Nov 30 2021 11:00am EST
47+
}
48+
4249
/** Change to the Auth page */
4350
gotoAuth() {
4451
this.goTo(`${PUBLIC_URL}/`);

0 commit comments

Comments
 (0)