From 2b829d1028a61869858ecd48e2f1801819e17488 Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Tue, 13 Aug 2019 22:15:47 -0400
Subject: robust google doc export api and cleanup

---
 src/client/views/MainView.tsx | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

(limited to 'src/client/views/MainView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 705eacc0c..7b15e9624 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -87,11 +87,6 @@ export class MainView extends React.Component {
             if (!("presentationView" in doc)) {
                 doc.presentationView = new List<Doc>([Docs.Create.TreeDocument([], { title: "Presentation" })]);
             }
-            if (!("googleDocId" in doc)) {
-                GoogleApiClientUtils.Docs.Create().then(id => {
-                    id && (doc.googleDocId = id);
-                });
-            }
             CurrentUserUtils.UserDocument.activeWorkspace = doc;
         }
     }
@@ -158,9 +153,9 @@ export class MainView extends React.Component {
         reaction(() => this.mainContainer, () => {
             let main = this.mainContainer, documentId;
             if (main && (documentId = StrCast(main.googleDocId))) {
-                GoogleApiClientUtils.Docs.Read({ documentId }).then(text => {
-                    text && Utils.CopyText(text);
-                    console.log(text);
+                let options = { documentId, removeNewlines: true };
+                GoogleApiClientUtils.Docs.ReadLines(options).then(lines => {
+                    console.log(lines);
                 });
             }
         });
-- 
cgit v1.2.3-70-g09d2

