Page MenuHomePhabricator

D9027.diff
No OneTemporary

D9027.diff

diff --git a/native/markdown/markdown-link.react.js b/native/markdown/markdown-link.react.js
--- a/native/markdown/markdown-link.react.js
+++ b/native/markdown/markdown-link.react.js
@@ -13,7 +13,7 @@
import { MarkdownSpoilerContext } from './markdown-spoiler-context.js';
import { MessagePressResponderContext } from '../chat/message-press-responder-context.js';
import { TextMessageMarkdownContext } from '../chat/text-message-markdown-context.js';
-import { InviteLinksContext } from '../invite-links/invite-links-context-provider.react.js';
+import { DeepLinksContext } from '../navigation/deep-links-context-provider.react.js';
import Alert from '../utils/alert.js';
import { normalizeURL } from '../utils/url-utils.js';
@@ -38,10 +38,10 @@
displayURL += '…';
}
- const inviteLinksContext = React.useContext(InviteLinksContext);
+ const deepLinksContext = React.useContext(DeepLinksContext);
return React.useCallback(() => {
if (url.startsWith(inviteLinkUrl(''))) {
- inviteLinksContext?.setCurrentLinkUrl(url);
+ deepLinksContext?.setCurrentLinkUrl(url);
return;
}
messageKey && setLinkModalActive({ [messageKey]: true });
@@ -61,7 +61,7 @@
displayURL,
onDismiss,
onConfirm,
- inviteLinksContext,
+ deepLinksContext,
]);
}
diff --git a/native/invite-links/invite-links-context-provider.react.js b/native/navigation/deep-links-context-provider.react.js
rename from native/invite-links/invite-links-context-provider.react.js
rename to native/navigation/deep-links-context-provider.react.js
--- a/native/invite-links/invite-links-context-provider.react.js
+++ b/native/navigation/deep-links-context-provider.react.js
@@ -20,11 +20,11 @@
useServerCall,
} from 'lib/utils/action-utils.js';
-import { InviteLinkModalRouteName } from '../navigation/route-names.js';
+import { InviteLinkModalRouteName } from './route-names.js';
import { useSelector } from '../redux/redux-utils.js';
import { useOnFirstLaunchEffect } from '../utils/hooks.js';
-type InviteLinksContextType = {
+type DeepLinksContextType = {
+setCurrentLinkUrl: SetState<?string>,
};
@@ -32,13 +32,13 @@
setCurrentLinkUrl: () => {},
};
-const InviteLinksContext: React.Context<InviteLinksContextType> =
- React.createContext<InviteLinksContextType>(defaultContext);
+const DeepLinksContext: React.Context<DeepLinksContextType> =
+ React.createContext<DeepLinksContextType>(defaultContext);
type Props = {
+children: React.Node,
};
-function InviteLinksContextProvider(props: Props): React.Node {
+function DeepLinksContextProvider(props: Props): React.Node {
const { children } = props;
const [currentLink, setCurrentLink] = React.useState(null);
@@ -121,10 +121,10 @@
);
return (
- <InviteLinksContext.Provider value={contextValue}>
+ <DeepLinksContext.Provider value={contextValue}>
{children}
- </InviteLinksContext.Provider>
+ </DeepLinksContext.Provider>
);
}
-export { InviteLinksContext, InviteLinksContextProvider };
+export { DeepLinksContext, DeepLinksContextProvider };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -34,10 +34,10 @@
import { SQLiteDataHandler } from './data/sqlite-data-handler.js';
import ErrorBoundary from './error-boundary.react.js';
import InputStateContainer from './input/input-state-container.react.js';
-import { InviteLinksContextProvider } from './invite-links/invite-links-context-provider.react.js';
import LifecycleHandler from './lifecycle/lifecycle-handler.react.js';
import MarkdownContextProvider from './markdown/markdown-context-provider.react.js';
import { filesystemMediaCache } from './media/media-cache.js';
+import { DeepLinksContextProvider } from './navigation/deep-links-context-provider.react.js';
import { defaultNavigationState } from './navigation/default-state.js';
import DisconnectedBarVisibilityHandler from './navigation/disconnected-bar-visibility-handler.react.js';
import { setGlobalNavContext } from './navigation/icky-global.js';
@@ -251,9 +251,9 @@
theme={theme}
ref={containerRef}
>
- <InviteLinksContextProvider>
+ <DeepLinksContextProvider>
<RootNavigator />
- </InviteLinksContextProvider>
+ </DeepLinksContextProvider>
<NavigationHandler />
</NavigationContainer>
);

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 3:22 PM (16 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571348
Default Alt Text
D9027.diff (4 KB)

Event Timeline