feat: route desktop matrix: deep links into the client
Adds useDeepLinkNavigate (mounted in ClientNonUIFeatures): listens for the 'lotus-deeplink' DOM CustomEvent that the Tauri shell dispatches when a matrix:/matrix.to link opens the app, converts matrix: URIs to matrix.to, and navigates via the same path as useMentionClickHandler (reusing matrix-to.ts parsers + useRoomNavigate). No-op outside Tauri. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import { useSelectedRoom } from '../../hooks/router/useSelectedRoom';
|
||||
import { useInboxNotificationsSelected } from '../../hooks/router/useInbox';
|
||||
import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
|
||||
import { usePresenceUpdater } from '../../hooks/usePresenceUpdater';
|
||||
import { useDeepLinkNavigate } from '../../hooks/useDeepLinkNavigate';
|
||||
import { toastQueueAtom } from '../../state/toast';
|
||||
|
||||
function isInQuietHours(start: string, end: string): boolean {
|
||||
@@ -376,6 +377,11 @@ type ClientNonUIFeaturesProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
function DeepLinkNavigator() {
|
||||
useDeepLinkNavigate();
|
||||
return null;
|
||||
}
|
||||
|
||||
export function ClientNonUIFeatures({ children }: ClientNonUIFeaturesProps) {
|
||||
return (
|
||||
<>
|
||||
@@ -385,6 +391,7 @@ export function ClientNonUIFeatures({ children }: ClientNonUIFeaturesProps) {
|
||||
<PresenceUpdater />
|
||||
<InviteNotifications />
|
||||
<MessageNotifications />
|
||||
<DeepLinkNavigator />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user