mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-19 20:11:31 +02:00
Merge pull request #178 from greenart7c3/next
if on android use citrine url for cache relay
This commit is contained in:
54
src/views/relays/cache/index.tsx
vendored
54
src/views/relays/cache/index.tsx
vendored
@@ -129,11 +129,53 @@ function NostrRelayTray() {
|
||||
</Button>
|
||||
)}
|
||||
</CardHeader>
|
||||
<CardBody p="4" pt="0">
|
||||
<CardBody p="4" pt="0">
|
||||
<Text mb="2">A cool little app that runs a local relay in your systems tray</Text>
|
||||
<Text>Maximum capacity: Unlimited</Text>
|
||||
<Text>Performance: As fast as your computer</Text>
|
||||
</CardBody>
|
||||
</CardBody>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
function CitrineRelay() {
|
||||
const { value: available, loading: checking } = useAsync(checkNostrRelayTray);
|
||||
|
||||
const enabled = localRelay?.url.startsWith(NOSTR_RELAY_TRAY_URL);
|
||||
const enable = () => {
|
||||
localStorage.setItem("localRelay", NOSTR_RELAY_TRAY_URL);
|
||||
location.reload();
|
||||
};
|
||||
|
||||
return (
|
||||
<Card borderColor={enabled ? "primary.500" : undefined} variant="outline">
|
||||
<CardHeader p="4" display="flex" gap="2" alignItems="center">
|
||||
<Heading size="md">Citrine</Heading>
|
||||
<Link color="blue.500" href="https://github.com/greenart7c3/Citrine" isExternal>
|
||||
GitHub
|
||||
</Link>
|
||||
{available ? (
|
||||
<Button size="sm" colorScheme="primary" ml="auto" isLoading={checking} onClick={enable} isDisabled={enabled}>
|
||||
{enabled ? "Enabled" : "Enable"}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
as={Link}
|
||||
isExternal
|
||||
href="https://github.com/greenart7c3/Citrine"
|
||||
colorScheme="blue"
|
||||
size="sm"
|
||||
ml="auto"
|
||||
>
|
||||
Get the app
|
||||
</Button>
|
||||
)}
|
||||
</CardHeader>
|
||||
<CardBody p="4" pt="0">
|
||||
<Text mb="2">A cool little app that runs a local relay in your phone</Text>
|
||||
<Text>Maximum capacity: Unlimited</Text>
|
||||
<Text>Performance: As fast as your phone</Text>
|
||||
</CardBody>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -260,7 +302,13 @@ export default function CacheRelayView() {
|
||||
</Text>
|
||||
<InternalRelay />
|
||||
{WasmRelay.SUPPORTED && <WasmWorkerRelay />}
|
||||
<NostrRelayTray />
|
||||
{
|
||||
navigator.userAgent.includes("Android") ? (
|
||||
<CitrineRelay />
|
||||
) : (
|
||||
<NostrRelayTray />
|
||||
)
|
||||
}
|
||||
{window.satellite && <SatelliteRelay />}
|
||||
{window.CACHE_RELAY_ENABLED && <HostedRelay />}
|
||||
<Button w="full" variant="link" p="4" onClick={showAdvanced.onToggle}>
|
||||
|
Reference in New Issue
Block a user