small changes

This commit is contained in:
hzrd149 2023-02-07 17:04:18 -06:00
parent ab3ac8b14c
commit 27260a9f9b
4 changed files with 17 additions and 5 deletions

View File

@ -5,7 +5,8 @@
"license": "MIT",
"scripts": {
"start": "vite serve",
"build": "vite build"
"build": "vite build",
"format": "prettier --ignore-path .gitignore -w ."
},
"devDependencies": {
"prettier": "^2.8.1",

View File

@ -19,6 +19,9 @@ export const Page = ({ children }) => {
<Box flexGrow={1} overflow="auto">
<ErrorBoundary>{children}</ErrorBoundary>
</Box>
<VStack style={{ width: "20rem" }} alignItems="stretch" flexShrink={0}>
<Button onClick={() => navigate("/")}>Manage Follows</Button>
</VStack>
</HStack>
</Container>
);

View File

@ -37,12 +37,11 @@ export const Post = ({ event }) => {
<Text>{moment(event.created_at * 1000).fromNow()}</Text>
</Box>
</Flex>
<EventSeenOn id={event.id} />
</Flex>
</CardHeader>
<CardBody pt={0}>
<VStack alignItems="flex-start" justifyContent="stretch">
<Box maxHeight="10rem" overflow="hidden" width="100%">
<Box maxHeight="20rem" overflow="hidden" width="100%">
<ReactMarkdown>
{event.content.replace(/(?<! )\n/g, " \n")}
</ReactMarkdown>

View File

@ -1,5 +1,6 @@
import { Subject } from "rxjs";
import { Relay } from "./relay";
import settingsService from "../settings";
export class RelayPool {
relays = new Map();
@ -18,9 +19,9 @@ export class RelayPool {
requestRelay(url, connect = true) {
if (!this.relays.has(url)) {
const newRelay = new Relay(url)
const newRelay = new Relay(url);
this.relays.set(url, newRelay);
this.onRelayCreated.next(newRelay)
this.onRelayCreated.next(newRelay);
}
const relay = this.relays.get(url);
@ -70,4 +71,12 @@ if (import.meta.env.DEV) {
window.relayPool = relayPool;
}
setTimeout(async () => {
const urls = await settingsService.getRelays();
for (const url of urls) {
relayPool.requestRelay(url);
}
}, 1000 * 10);
export default relayPool;