Live video on the AT Protocol
1import { LinkingOptions } from "@react-navigation/native";
2import React, { useEffect } from "react";
3import SharedProvider from "./provider.shared";
4
5export default function Provider({
6 children,
7 linking,
8}: {
9 children: React.ReactNode;
10 linking: LinkingOptions<ReactNavigation.RootParamList>;
11}) {
12 useEffect(() => {
13 // atproto requires 127.0.0.1 rather than localhost
14 const u = new URL(document.location.href);
15 if (u.hostname === "localhost") {
16 u.hostname = "127.0.0.1";
17 document.location.href = u.toString();
18 }
19 }, []);
20 return <SharedProvider linking={linking}>{children}</SharedProvider>;
21}