From 09dc82df67c4ec0864169307eb05bb08955d13f9 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 5 Aug 2020 17:22:54 +0300 Subject: [PATCH] Fix Debug page. --- src/Debug.tsx | 77 ++++++++++++++++++++++++------------------------ src/SyncGate.tsx | 5 +--- 2 files changed, 39 insertions(+), 43 deletions(-) diff --git a/src/Debug.tsx b/src/Debug.tsx index 7330b3a..4bcd41e 100644 --- a/src/Debug.tsx +++ b/src/Debug.tsx @@ -2,25 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from "react"; -import * as EteSync from "etesync"; +import * as Etebase from "etebase"; import Button from "@material-ui/core/Button"; import TextField from "@material-ui/core/TextField"; import Container from "./widgets/Container"; import { useSelector } from "react-redux"; -import { StoreState, CredentialsData, UserInfoData, EntriesListData } from "./store"; +import { StoreState } from "./store"; +import { useCredentials } from "./credentials"; +import { getCollectionManager } from "./etebase-helpers"; -interface PropsType { - etesync: CredentialsData; - userInfo: UserInfoData; -} - -export default function Debug(props: PropsType) { - const [stateJournalUid, setJournalUid] = React.useState(""); - const [entriesUids, setEntriesUids] = React.useState(""); +export default function Debug() { + const etebase = useCredentials()!; + const [stateCollectionUid, setCollectionUid] = React.useState(""); + const [itemsUids, setEntriesUids] = React.useState(""); const [result, setResult] = React.useState(""); - const journals = useSelector((state: StoreState) => state.cache.journals!); - const journalEntries = useSelector((state: StoreState) => state.cache.entries); + const cacheCollections = useSelector((state: StoreState) => state.cache2.collections); + const cacheItems = useSelector((state: StoreState) => state.cache2.items); function handleInputChange(func: (value: string) => void) { return (event: React.ChangeEvent) => { @@ -34,9 +32,9 @@ export default function Debug(props: PropsType) {
@@ -44,42 +42,43 @@ export default function Debug(props: PropsType) { style={{ width: "100%" }} type="text" multiline - label="Entry UIDs" - value={entriesUids} + label="Item UIDs" + value={itemsUids} onChange={handleInputChange(setEntriesUids)} />