Skip to content

Commit c359422

Browse files
committed
Handle base64 content
1 parent 7e6eab1 commit c359422

File tree

1 file changed

+4
-3
lines changed
  • packages/my-shared-docprovider/src

1 file changed

+4
-3
lines changed

packages/my-shared-docprovider/src/drive.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ export class MySharedDrive extends Drive implements ICollaborativeDrive {
159159
translator: this._trans
160160
});
161161

162-
this._app.serviceManager.contents.get(options.path, { content: true, format: 'text' }).then(model => {
163-
console.log('set model source to:', model.content);
164-
provider.setSource(model.content);
162+
this._app.serviceManager.contents.get(options.path, { content: true }).then(model => {
163+
console.log('set model source:', model);
164+
const content = model.format === 'base64' ? atob(model.content) : model.content;
165+
provider.setSource(content);
165166
});
166167

167168
const key = `${options.format}:${options.contentType}:${options.path}`;

0 commit comments

Comments
 (0)