aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaafiyan Ahmed <naafiyan@gmail.com>2022-05-04 13:33:09 -0400
committerNaafiyan Ahmed <naafiyan@gmail.com>2022-05-04 13:33:09 -0400
commitf484500cb96213f6291eb3977a614a672d778441 (patch)
tree077d8455916f7a832927b59d8c9875f2c1951e2f
parent1b9b36d87fd06a3d53586e18bea390a25c31c091 (diff)
fix: single words no longer disappear
-rw-r--r--src/client/views/InkTranscription.tsx17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/client/views/InkTranscription.tsx b/src/client/views/InkTranscription.tsx
index ca0f9792d..0e8ccd57b 100644
--- a/src/client/views/InkTranscription.tsx
+++ b/src/client/views/InkTranscription.tsx
@@ -1,13 +1,12 @@
import * as iink from 'iink-js';
import { action, observable } from 'mobx';
import * as React from 'react';
-import { DataSym, Doc, DocListCast, HeightSym, WidthSym, LayoutSym } from '../../fields/Doc';
+import { Doc, DocListCast, HeightSym, WidthSym } from '../../fields/Doc';
import { InkData, InkField } from "../../fields/InkField";
import { Cast, DateCast, NumCast } from '../../fields/Types';
import { DocumentType } from "../documents/DocumentTypes";
import './InkTranscription.scss';
-import { aggregateBounds, Utils } from '../../Utils';
-import { timesSeries } from 'async';
+import { aggregateBounds } from '../../Utils';
import { CollectionFreeFormView } from './collections/collectionFreeForm';
import { DocumentManager } from "../util/DocumentManager";
@@ -21,17 +20,12 @@ export class InkTranscription extends React.Component {
@observable _textRef: any;
private lastJiix: any;
private currGroup?: Doc;
- private wordsBoundMapping: any;
- private inkDocs: Doc[];
- private ffView: any;
private containingLayout?: Doc;
constructor(props: Readonly<{}>) {
super(props);
InkTranscription.Instance = this;
- this.wordsBoundMapping = new Map<any, any>();
- this.inkDocs = new Array<Doc>();
}
componentWillUnmount() {
@@ -111,11 +105,6 @@ export class InkTranscription extends React.Component {
transcribeInk = (groupDoc: Doc | undefined, containingLayout: Doc, inkDocs: Doc[], math: boolean, ffView?: CollectionFreeFormView) => {
if (!groupDoc) return;
- this.inkDocs = inkDocs;
- if (ffView) {
- this.ffView = ffView;
- }
-
const validInks = inkDocs.filter(s => s.type === DocumentType.INK);
const strokes: InkData[] = [];
@@ -290,7 +279,7 @@ export class InkTranscription extends React.Component {
wordInkDocMap.set(word, newEntry);
}
});
- this.subgroupsTranscriptions(wordInkDocMap);
+ if (this.lastJiix.words.length > 1) this.subgroupsTranscriptions(wordInkDocMap);
}
}
const text = exports['text/plain'];