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.tsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 8c2af7c9e..50ec27259 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -670,16 +670,18 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
}
exportToGoogleDoc = () => {
- let dataDoc = Doc.GetProto(this.props.Document);
- let data = Cast(dataDoc.data, RichTextField);
- let content: string | undefined;
- if (data && (content = data.plainText())) {
- GoogleApiClientUtils.Docs.Write({
- title: StrCast(dataDoc.title),
- store: { receiver: dataDoc, key: googleDocKey },
- content
- });
+ const dataDoc = Doc.GetProto(this.props.Document);
+ const data = Cast(dataDoc.data, RichTextField);
+ if (!data) {
+ return;
}
+ GoogleApiClientUtils.Docs.Write({
+ reference: {
+ title: StrCast(dataDoc.title),
+ handler: id => dataDoc[googleDocKey] = id
+ },
+ content: data.plainText()
+ });
}
render() {