mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-04 16:37:00 +02:00
small fixes
This commit is contained in:
5
.changeset/dull-cycles-look.md
Normal file
5
.changeset/dull-cycles-look.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"nostrudel": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix error when clearing database cache
|
5
.changeset/itchy-penguins-care.md
Normal file
5
.changeset/itchy-penguins-care.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"nostrudel": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix scrolling in direct messages view
|
@@ -1,5 +1,8 @@
|
|||||||
import { openDB, deleteDB, IDBPDatabase } from "idb";
|
import { openDB, deleteDB, IDBPDatabase } from "idb";
|
||||||
import { SchemaV1, SchemaV2, SchemaV3, SchemaV4 } from "./schema";
|
import { SchemaV1, SchemaV2, SchemaV3, SchemaV4 } from "./schema";
|
||||||
|
import { logger } from "../../helpers/debug";
|
||||||
|
|
||||||
|
const log = logger.extend("Database");
|
||||||
|
|
||||||
const dbName = "storage";
|
const dbName = "storage";
|
||||||
const version = 4;
|
const version = 4;
|
||||||
@@ -87,17 +90,31 @@ const db = await openDB<SchemaV4>(dbName, version, {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
log("Open");
|
||||||
|
|
||||||
export async function clearCacheData() {
|
export async function clearCacheData() {
|
||||||
|
log("Clearing replaceableEvents");
|
||||||
await db.clear("replaceableEvents");
|
await db.clear("replaceableEvents");
|
||||||
await db.clear("userFollows");
|
|
||||||
|
log("Clearing userSearch");
|
||||||
|
await db.clear("userSearch");
|
||||||
|
|
||||||
|
log("Clearing relayInfo");
|
||||||
await db.clear("relayInfo");
|
await db.clear("relayInfo");
|
||||||
|
|
||||||
|
log("Clearing dnsIdentifiers");
|
||||||
await db.clear("dnsIdentifiers");
|
await db.clear("dnsIdentifiers");
|
||||||
|
|
||||||
|
log("Clearing relayScoreboardStats");
|
||||||
await db.clear("relayScoreboardStats");
|
await db.clear("relayScoreboardStats");
|
||||||
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteDatabase() {
|
export async function deleteDatabase() {
|
||||||
|
log("Closing");
|
||||||
db.close();
|
db.close();
|
||||||
|
log("Deleting");
|
||||||
await deleteDB(dbName);
|
await deleteDB(dbName);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,7 @@ import { useTimelineCurserIntersectionCallback } from "../../hooks/use-timeline-
|
|||||||
import TimelineActionAndStatus from "../../components/timeline-page/timeline-action-and-status";
|
import TimelineActionAndStatus from "../../components/timeline-page/timeline-action-and-status";
|
||||||
import NostrPublishAction from "../../classes/nostr-publish-action";
|
import NostrPublishAction from "../../classes/nostr-publish-action";
|
||||||
import { LightboxProvider } from "../../components/lightbox-provider";
|
import { LightboxProvider } from "../../components/lightbox-provider";
|
||||||
|
import VerticalPageLayout from "../../components/vertical-page-layout";
|
||||||
|
|
||||||
function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
|
function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
@@ -71,7 +72,7 @@ function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
|
|||||||
return (
|
return (
|
||||||
<LightboxProvider>
|
<LightboxProvider>
|
||||||
<IntersectionObserverProvider callback={callback}>
|
<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}>
|
<Card size="sm" flexShrink={0}>
|
||||||
<CardBody display="flex" gap="2" alignItems="center">
|
<CardBody display="flex" gap="2" alignItems="center">
|
||||||
<IconButton variant="ghost" icon={<ChevronLeftIcon />} aria-label="Back" onClick={() => navigate(-1)} />
|
<IconButton variant="ghost" icon={<ChevronLeftIcon />} aria-label="Back" onClick={() => navigate(-1)} />
|
||||||
@@ -79,7 +80,7 @@ function DirectMessageChatPage({ pubkey }: { pubkey: string }) {
|
|||||||
<UserLink pubkey={pubkey} />
|
<UserLink pubkey={pubkey} />
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</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) => (
|
{[...messages].map((event) => (
|
||||||
<Message key={event.id} event={event} />
|
<Message key={event.id} event={event} />
|
||||||
))}
|
))}
|
||||||
|
Reference in New Issue
Block a user