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

Fix: page.resolve.then inline promise never resolving #2135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Smef
Copy link
Contributor

@Smef Smef commented Dec 14, 2024

When the <WhenVisible> component is used with preserveUrl: true the promise in page.resolve never actually resolves since history isn't being replaced and the callback is never called.

Example:

        <WhenVisible
            always
            :params="{
                data: {
                    page: nextPageToLoad,
                },
                only: ['paginatedData'],
                preserveUrl: true,
            }"
        >
            <template #fallback>
                <div>Loading...</div>
            </template>
            <div></div>
        </WhenVisible>

This will get stuck forever and never resolve.

This PR adjusts page.set when it returns page.resolve.then so that the promises it creates resolve without depending on the callback if preserveUrl is set to true. The callback is still used if preserveUrl is false, since the callback is queued normally in that scenario.

@Smef Smef changed the title Fix: page.resolve.then promise never resolving Fix: page.resolve.then inline promise never resolving Dec 14, 2024
@Smef Smef force-pushed the fix-page.resolve-promise-never-resolving branch from db67579 to 90dff75 Compare December 14, 2024 01:34
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.

1 participant