mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-28 20:43:33 +02:00
fix clear internal database
This commit is contained in:
8
src/views/relays/cache/index.tsx
vendored
8
src/views/relays/cache/index.tsx
vendored
@@ -5,7 +5,6 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
ButtonGroupProps,
|
ButtonGroupProps,
|
||||||
ButtonProps,
|
|
||||||
Card,
|
Card,
|
||||||
CardBody,
|
CardBody,
|
||||||
CardFooter,
|
CardFooter,
|
||||||
@@ -22,16 +21,15 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { CacheRelay } from "nostr-idb";
|
import { CacheRelay, clearDB } from "nostr-idb";
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
|
|
||||||
import BackButton from "../../../components/router/back-button";
|
import BackButton from "../../../components/router/back-button";
|
||||||
import { NOSTR_RELAY_TRAY_URL, checkNostrRelayTray, localRelay } from "../../../services/local-relay";
|
import { NOSTR_RELAY_TRAY_URL, checkNostrRelayTray, localDatabase, localRelay } from "../../../services/local-relay";
|
||||||
import { ChevronDownIcon, ChevronUpIcon } from "../../../components/icons";
|
import { ChevronDownIcon, ChevronUpIcon } from "../../../components/icons";
|
||||||
import WasmRelay from "../../../services/wasm-relay";
|
import WasmRelay from "../../../services/wasm-relay";
|
||||||
import MemoryRelay from "../../../classes/memory-relay";
|
import MemoryRelay from "../../../classes/memory-relay";
|
||||||
import Trash01 from "../../../components/icons/trash-01";
|
import Trash01 from "../../../components/icons/trash-01";
|
||||||
import { deleteDatabase } from "../../../services/db";
|
|
||||||
|
|
||||||
function EnableWithDelete({
|
function EnableWithDelete({
|
||||||
enable,
|
enable,
|
||||||
@@ -78,7 +76,7 @@ function InternalRelay() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const wipe = async () => {
|
const wipe = async () => {
|
||||||
await deleteDatabase();
|
await clearDB(localDatabase);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user