fix: fixed the post upload redirect on mobile in pictuqe and prevente…#1038
Conversation
…d the double clicking of button on post in mobile.
|
Warning Review limit reached
More reviews will be available in 46 minutes and 26 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesPost Submission Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@platforms/pictique/client/src/routes/`(protected)/post/+page.svelte:
- Around line 61-65: The onDestroy hook unconditionally clears
uploadedImages.value and calls revokeImageUrls whenever the component is
destroyed, but this also fires when navigating to sub-routes like /post/audience
where the parent component is destroyed while the user is still within the
/post* route tree. Add a condition to the onDestroy hook to only perform the
cleanup (calling revokeImageUrls and setting uploadedImages.value to null) when
actually exiting the /post* route family entirely, not when navigating within
it. Check the current route to determine whether cleanup should proceed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 62ca2ccf-4cf3-4df7-8521-c8d7486e3414
📒 Files selected for processing (2)
platforms/pictique/client/src/lib/ui/Button/Button.svelteplatforms/pictique/client/src/routes/(protected)/post/+page.svelte
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@platforms/pictique/client/src/routes/`(protected)/post/+page.svelte:
- Around line 60-65: The issue is that setting uploadedImages.value to null
inside the beforeNavigate hook triggers a $effect (at line 16) that calls
window.history.back(), which races with the intended navigation (like
goto('/home')). To fix this, either add a flag or guard to prevent the $effect
from calling window.history.back() when the route is intentionally being exited,
or defer the cleanup of uploadedImages.value until after the component unmounts
rather than doing it inside beforeNavigate. The goal is to ensure the
back-navigation effect only runs when appropriate (e.g., unsaved changes with a
user-triggered back), not as a side effect of the cleanup logic during
intentional route transitions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2ee967e7-4ef9-4017-aad5-a4953fa25aa9
📒 Files selected for processing (1)
platforms/pictique/client/src/routes/(protected)/post/+page.svelte
…d the double clicking of button on post in mobile.
Description of change
fixed the post upload redirect on mobile in pictuqe and prevented the double clicking of button on post in mobile.
Issue Number
Closes #1032
Type of change
How the change has been tested
Manually.
Change checklist
Summary by CodeRabbit
Bug Fixes
New Features