There was an error while loading. Please reload this page.
1 parent 68c305f commit a22b108Copy full SHA for a22b108
1 file changed
platforms/pictique/client/src/routes/(protected)/post/+page.svelte
@@ -12,9 +12,10 @@
12
13
let caption: string = $state('');
14
let error: string = $state('');
15
+ let isLeavingPostRoute = false;
16
17
$effect(() => {
- if (!uploadedImages.value || uploadedImages.value.length === 0) {
18
+ if (!isLeavingPostRoute && (!uploadedImages.value || uploadedImages.value.length === 0)) {
19
window.history.back();
20
}
21
});
@@ -59,6 +60,7 @@
59
60
61
beforeNavigate(({ to }) => {
62
if (!to?.url.pathname.startsWith('/post')) {
63
+ isLeavingPostRoute = true;
64
if (uploadedImages.value) {
65
revokeImageUrls(uploadedImages.value);
66
uploadedImages.value = null;
0 commit comments