Skip to content

Commit

Permalink
Use goto over setting location
Browse files Browse the repository at this point in the history
Setting the location doesn't give svelte a chance to intercept the navigation and due to this, the whole page gets reloaded.
  • Loading branch information
Caleb-T-Owens committed Jan 24, 2025
1 parent 428f3f8 commit 9d43572
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { goto } from '$app/navigation';

Check failure on line 2 in apps/web/src/routes/[ownerSlug]/[projectSlug]/reviews/[branchId]/commit/[changeId]/+page.svelte

View workflow job for this annotation

GitHub Actions / lint-node

`$app/navigation` import should occur after import of `@gitbutler/shared/routing/webRoutes.svelte`
import ChatComponent from '$lib/components/ChatComponent.svelte';
import ChangeActionButton from '$lib/components/review/ChangeActionButton.svelte';
import ChangeNavigator from '$lib/components/review/ChangeNavigator.svelte';
Expand Down Expand Up @@ -80,7 +81,7 @@
changeId
});
window.location.href = url;
goto(url);
}
</script>

Expand Down

0 comments on commit 9d43572

Please sign in to comment.