feat: add infra code (#2718)

(cherry picked from commit f3fd5ff76b)
This commit is contained in:
Himself65
2023-06-08 09:41:20 +08:00
committed by himself65
parent 02757e53c1
commit 7f3632a25e
22 changed files with 283 additions and 16 deletions
@@ -122,7 +122,6 @@ const useDefaultDBLocation = () => {
const [defaultDBLocation, setDefaultDBLocation] = useState('');
useEffect(() => {
// @ts-expect-error
window.apis?.db.getDefaultStorageLocation().then(dir => {
setDefaultDBLocation(dir);
});
@@ -27,7 +27,6 @@ const useShowOpenDBFile = (workspaceId: string) => {
const [show, setShow] = useState(false);
useEffect(() => {
if (window.apis && window.events && environment.isDesktop) {
// @ts-expect-error
window.apis.workspace.getMeta(workspaceId).then(meta => {
setShow(!!meta.secondaryDBPath);
});