aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/CurrentUserUtils.ts6
-rw-r--r--src/client/util/DictationManager.ts7
-rw-r--r--src/client/util/DocumentManager.ts4
-rw-r--r--src/client/util/DragManager.ts2
-rw-r--r--src/client/util/Import & Export/DirectoryImportBox.tsx4
-rw-r--r--src/client/util/LinkManager.ts2
6 files changed, 13 insertions, 12 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 6e2a72f3a..600c143a7 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -535,11 +535,11 @@ export class CurrentUserUtils {
// setup the "creator" buttons for the sidebar-- eg. the default set of draggable document creation tools
static async setupCreatorButtons(doc: Doc) {
let alreadyCreatedButtons: string[] = [];
- const dragCreatorSet = await Cast(doc.myItemCreators, Doc, null);
+ const dragCreatorSet = Cast(doc.myItemCreators, Doc, null);
if (dragCreatorSet) {
- const dragCreators = await Cast(dragCreatorSet.data, listSpec(Doc));
+ const dragCreators = Cast(dragCreatorSet.data, listSpec(Doc));
if (dragCreators) {
- const dragDocs = await Promise.all(dragCreators);
+ const dragDocs = await Promise.all(Array.from(dragCreators));
alreadyCreatedButtons = dragDocs.map(d => StrCast(d.title));
}
}
diff --git a/src/client/util/DictationManager.ts b/src/client/util/DictationManager.ts
index a93b2f573..a086ac45e 100644
--- a/src/client/util/DictationManager.ts
+++ b/src/client/util/DictationManager.ts
@@ -1,4 +1,6 @@
import * as interpreter from "words-to-numbers";
+// @ts-ignore bcz: how are you supposed to include these definitions since dom-speech-recognition isn't a module?
+import type { } from "@types/dom-speech-recognition";
import { Doc, Opt } from "../../fields/Doc";
import { List } from "../../fields/List";
import { RichTextField } from "../../fields/RichTextField";
@@ -13,6 +15,7 @@ import { DocumentView } from "../views/nodes/DocumentView";
import { SelectionManager } from "./SelectionManager";
import { UndoManager } from "./UndoManager";
+
/**
* This namespace provides a singleton instance of a manager that
* handles the listening and text-conversion of user speech.
@@ -112,7 +115,7 @@ export namespace DictationManager {
}
options?.tryExecute && await DictationManager.Commands.execute(results);
}
- } catch (e) {
+ } catch (e: any) {
console.log(e);
if (overlay) {
DictationOverlay.Instance.isListening = false;
@@ -188,7 +191,7 @@ export namespace DictationManager {
current && sessionResults.push(current);
sessionResults.length && resolve(sessionResults.join(inter || interSession));
} else {
- resolve(current);
+ resolve(current || "");
}
current = undefined;
sessionResults = [];
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 66b6a1e44..e1dc96155 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -198,7 +198,7 @@ export class DocumentManager {
originalTarget, willZoom, scale: presZoom, afterFocus: (didFocus: boolean) =>
new Promise<ViewAdjustment>(res => {
focusAndFinish(didFocus);
- res();
+ res(ViewAdjustment.doNothing);
})
});
} else {
@@ -227,7 +227,7 @@ export class DocumentManager {
willZoom, afterFocus: (didFocus: boolean) =>
new Promise<ViewAdjustment>(res => {
!noSelect && focusAndFinish(didFocus);
- res();
+ res(ViewAdjustment.doNothing);
})
}); // focus on the target in the context
} else if (delay > 1500) {
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index ae3fa3170..c9c499fff 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -499,7 +499,7 @@ export namespace DragManager {
screenX: e.screenX,
screenY: e.screenY,
detail: e.detail,
- view: e.view ? e.view : new Window,
+ view: e.view ? e.view : new Window as any,
nativeEvent: new DragEvent("dashDragAutoScroll"),
currentTarget: target,
target: target,
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx
index cf72cd0df..9eee75253 100644
--- a/src/client/util/Import & Export/DirectoryImportBox.tsx
+++ b/src/client/util/Import & Export/DirectoryImportBox.tsx
@@ -1,9 +1,7 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { BatchedArray } from "array-batcher";
-import "fs";
import { action, computed, IReactionDisposer, observable, reaction, runInAction } from "mobx";
import { observer } from "mobx-react";
-import * as path from 'path';
import Measure, { ContentRect } from "react-measure";
import { Doc, DocListCast, DocListCastAsync, Opt } from "../../../fields/Doc";
import { Id } from "../../../fields/FieldSymbols";
@@ -120,7 +118,7 @@ export class DirectoryImportBox extends React.Component<FieldViewProps> {
}
const { accessPaths, exifData } = result;
const path = Utils.prepend(accessPaths.agnostic.client);
- const document = type && await DocUtils.DocumentFromType(type, path, { _width: 300, title: name });
+ const document = type && await DocUtils.DocumentFromType(type, path, { _width: 300 });
const { data, error } = exifData;
if (document) {
Doc.GetProto(document).exif = error || Doc.Get.FromJson({ data });
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index 62b13e2c6..df2c02a8d 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -194,7 +194,7 @@ export class LinkManager {
afterFocus: (didFocus: boolean) => {
finished?.();
res(ViewAdjustment.resetView);
- return new Promise<ViewAdjustment>(res2 => res2());
+ return new Promise<ViewAdjustment>(res2 => res2(ViewAdjustment.doNothing));
}
});
} else {