Skip to content
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

Update preview when file is updated in ImageEditor #1554

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Feb 23, 2023

After editing an image with the new editor, the preview stays the same when closing the editor. This PR makes sure that the preview will be updated.

Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
Copy link
Contributor Author

artonge commented Feb 23, 2023

/backport to stable25

@backportbot-nextcloud backportbot-nextcloud bot added the backport-request Pending backport by the backport-bot label Feb 23, 2023
@artonge artonge self-assigned this Feb 23, 2023
@artonge artonge added bug Something isn't working javascript Javascript related ticket and removed backport-request Pending backport by the backport-bot labels Feb 23, 2023
@artonge artonge added this to the Nextcloud 26 milestone Feb 23, 2023
@artonge artonge requested review from skjnldsv, a team, Pytal and szaimen and removed request for a team February 23, 2023 14:36
@close="onClose" />

<img v-else
<img v-else-if="data !== null"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed as we are using a concatenation for the src prop which seem to interfere with AsyncComputed logic.
The issue was that a request with null was sent instead of waiting for data to be initialized.

:alt="alt"
:class="{
dragging,
loaded,
zoomed: zoomRatio !== 1
}"
:src="data"
:src="`${data}${cacheBuster}`"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple approach, but it works. Sexier idea welcome. :)

This makes sure that the initial request can use the browser's cache, and that on an update the cache is busted with ?buster=1

@skjnldsv skjnldsv merged commit 756962a into master Feb 23, 2023
@skjnldsv skjnldsv deleted the artonge/feat/reload_preview_on_update branch February 23, 2023 16:47
@backportbot-nextcloud backportbot-nextcloud bot added the backport-request Pending backport by the backport-bot label Feb 23, 2023
@backportbot-nextcloud backportbot-nextcloud bot removed the backport-request Pending backport by the backport-bot label Feb 23, 2023
@artonge artonge mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Javascript related ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants