Merge branch 'next'

This commit is contained in:
hzrd149 2023-10-28 12:15:09 -05:00
commit fbc0d0db1f
8 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,5 @@
---
"nostrudel": patch
---
Fix error when clearing database cache

View File

@ -0,0 +1,5 @@
---
"nostrudel": patch
---
Fix scrolling in direct messages view

View File

@ -0,0 +1,5 @@
---
"nostrudel": patch
---
Fix community join button "no account" error

View File

@ -1,5 +1,8 @@
import { openDB, deleteDB, IDBPDatabase } from "idb";
import { SchemaV1, SchemaV2, SchemaV3, SchemaV4 } from "./schema";
import { logger } from "../../helpers/debug";
const log = logger.extend("Database");
const dbName = "storage";
const version = 4;
@ -87,17 +90,31 @@ const db = await openDB<SchemaV4>(dbName, version, {
},
});
log("Open");
export async function clearCacheData() {
log("Clearing replaceableEvents");
await db.clear("replaceableEvents");
await db.clear("userFollows");
log("Clearing userSearch");
await db.clear("userSearch");
log("Clearing relayInfo");
await db.clear("relayInfo");
log("Clearing dnsIdentifiers");
await db.clear("dnsIdentifiers");
log("Clearing relayScoreboardStats");
await db.clear("relayScoreboardStats");
window.location.reload();
}
export async function deleteDatabase() {
log("Closing");
db.close();
log("Deleting");
await deleteDB(dbName);
window.location.reload();
}

View File

@ -47,7 +47,7 @@ export default function CommunityJoinButton({
} catch (e) {
if (e instanceof Error) toast({ description: e.message, status: "error" });
}
}, [isSubscribed, list, community]);
}, [isSubscribed, list, community, requestSignature, toast]);
return (
<Button

View File

@ -25,7 +25,7 @@ import CommunityDescription from "../../communities/components/community-descrip
import UserAvatarLink from "../../../components/user-avatar-link";
import { UserLink } from "../../../components/user-link";
import { NostrEvent } from "../../../types/nostr-event";
import CommunityJoinButton from "../../communities/components/community-subscribe-button";
import CommunityJoinButton from "../../communities/components/community-join-button";
import CommunityMenu from "./community-menu";
import useCountCommunityMembers from "../../../hooks/use-count-community-members";
import { readablizeSats } from "../../../helpers/bolt11";

View File

@ -12,7 +12,7 @@ import CommunityDescription from "../../communities/components/community-descrip
import UserAvatarLink from "../../../components/user-avatar-link";
import { UserLink } from "../../../components/user-link";
import { NostrEvent } from "../../../types/nostr-event";
import CommunityJoinButton from "../../communities/components/community-subscribe-button";
import CommunityJoinButton from "../../communities/components/community-join-button";
import CommunityMenu from "./community-menu";
import useCountCommunityMembers from "../../../hooks/use-count-community-members";
import CommunityMembersModal from "./community-members-modal";

View File

@ -22,6 +22,7 @@ import { useTimelineCurserIntersectionCallback } from "../../hooks/use-timeline-
import TimelineActionAndStatus from "../../components/timeline-page/timeline-action-and-status";
import NostrPublishAction from "../../classes/nostr-publish-action";
import { LightboxProvider } from "../../components/lightbox-provider";
import VerticalPageLayout from "../../components/vertical-page-layout";
function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
const toast = useToast();
@ -71,7 +72,7 @@ function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
return (
<LightboxProvider>
<IntersectionObserverProvider callback={callback}>
<Flex height="100%" overflow="hidden" direction="column">
<Flex maxH={{ base: "calc(100vh - 3.5rem)", md: "100vh" }} overflow="hidden" direction="column">
<Card size="sm" flexShrink={0}>
<CardBody display="flex" gap="2" alignItems="center">
<IconButton variant="ghost" icon={<ChevronLeftIcon />} aria-label="Back" onClick={() => navigate(-1)} />
@ -79,7 +80,7 @@ function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
<UserLink pubkey={pubkey} />
</CardBody>
</Card>
<Flex flex={1} overflowX="hidden" overflowY="scroll" direction="column-reverse" gap="2" py="4" px="2">
<Flex h="0" flex={1} overflowX="hidden" overflowY="scroll" direction="column-reverse" gap="2" py="4" px="2">
{[...messages].map((event) => (
<Message key={event.id} event={event} />
))}