aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
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