aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-14 03:41:11 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-14 03:41:11 -0400
commit48fcec82fa384ec260a02965f9f78c2e41256dd9 (patch)
treeefe6bd570c210a5e7a3530bc11eccf7abb6ae67b /src/client/views/nodes/FormattedTextBox.tsx
parentdc766185075b5861686c68a704a8e49213eacbc6 (diff)
clean up and regex improvement
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 50ec27259..46aed9b2d 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -288,6 +288,19 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
}
}
+ componentWillMount() {
+ this.pollExportedCounterpart();
+ }
+
+ pollExportedCounterpart = async () => {
+ let dataDoc = Doc.GetProto(this.props.Document);
+ let documentId = StrCast(dataDoc[googleDocKey]);
+ if (documentId) {
+ let contents = await GoogleApiClientUtils.Docs.read({ documentId });
+ contents ? console.log(contents) : delete dataDoc[googleDocKey];
+ }
+ }
+
componentDidMount() {
const config = {
schema,
@@ -675,7 +688,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
if (!data) {
return;
}
- GoogleApiClientUtils.Docs.Write({
+ GoogleApiClientUtils.Docs.write({
reference: {
title: StrCast(dataDoc.title),
handler: id => dataDoc[googleDocKey] = id