Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/DirectEditing/TextDirectEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public function open(IToken $token): Response {
$this->initialStateService->provideInitialState('text', 'file', [
'fileId' => $token->getFile()->getId(),
'mimetype' => $token->getFile()->getMimeType(),
'content' => $token->getFile()->getContent(),
'session' => \json_encode($session->getData())
]);
$this->initialStateService->provideInitialState('text', 'directEditingToken', $token->getToken());
Expand Down
4 changes: 1 addition & 3 deletions src/services/SyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,10 @@ class SyncService {
document: this.document,
session: this.session,
})
const content = connectionData.content
|| await this._fetchDocument()
this.emit('loaded', {
document: this.document,
session: this.session,
documentSource: '' + content,
documentSource: '' + connectionData.content,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same thing we removed above? I'm confused. 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, which is fine still just without the fetch fallback

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main problem was that an empty string (from a file without content) would always trigger the fetch request which is actually not necessary anymore as we always pass the content earlier.

Copy link
Contributor

@Raudius Raudius Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick, but could we just cast it?

documentSource: String(connectionData.content)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, this is already a backport 🙈

Approved

})
}

Expand Down