Skip to content

Fix loading slide images from a relative directory in tldraw v2 #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

kepstin
Copy link
Contributor

@kepstin kepstin commented Sep 24, 2024

The tldraw v2 code was prepending the origin of the current page to the slide image urls, if they didn't start with "http". This resulted in it generating invalid URLs that look like:
https://example.compresentation/ea5b16cd4eef022e866b1462aed02a43342a80a8-1726509771537/svgs/slide1.svg when the playback is compiled to load from a relative URL (i.e. with REACT_APP_NO_ROUTER=1 PUBLIC_URL=. )

The cause appears to be that some dead code (assignment to an unused variable) was copied from the tldraw v1 code, and then code later in the file was adjusted to use that variable, making its behaviour differ from tldraw v1.

Remove the unused code from tldraw v1, and adjust tldraw v2 to match the behaviour of tldraw v1.

The tldraw v2 code was prepending the origin of the current page to
the slide image urls, if they didn't start with "http". This resulted
in it generating invalid URLs that look like:
https://example.compresentation/ea5b16cd4eef022e866b1462aed02a43342a80a8-1726509771537/svgs/slide1.svg
when the playback is compiled to load from a relative URL (i.e. with
`REACT_APP_NO_ROUTER=1 PUBLIC_URL=.` )

The cause appears to be that some dead code (assignment to an unused
variable) was copied from the tldraw v1 code, and then code later in the
file was adjusted to use that variable, making its behaviour differ from
tldraw v1.

Remove the unused code from tldraw v1, and adjust tldraw v2 to match the
behaviour of tldraw v1.
Copy link
Collaborator

@danielpetri1 danielpetri1 left a comment

Choose a reason for hiding this comment

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

LGTM! Tested by joining a new meeting, starting a recording, adding a few annotations, and watching the playback. Slides rendered correctly.

@antobinary antobinary merged commit 6f2865a into bigbluebutton:develop Sep 24, 2024
1 check passed
@kepstin kepstin deleted the tldraw2-rel-slides branch September 25, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants