Fix archive redirect route typing

This commit is contained in:
Mohamed Boudra
2026-05-28 15:40:36 +07:00
parent 990bca71b7
commit c4f9874e1f
3 changed files with 7 additions and 4 deletions
@@ -1,3 +1,4 @@
import type { Href } from "expo-router";
import { describe, expect, it } from "vitest";
import { buildWorkspaceArchiveRedirectRoute } from "@/utils/workspace-archive-navigation";
import type { WorkspaceDescriptor } from "@/stores/session-store";
@@ -82,9 +83,9 @@ describe("buildWorkspaceArchiveRedirectRoute", () => {
function createFakeRouter(workspaces: WorkspaceDescriptor[]): {
deps: RedirectIfArchivingActiveWorkspaceDeps;
routes: string[];
routes: Href[];
} {
const routes: string[] = [];
const routes: Href[] = [];
return {
routes,
deps: {
@@ -1,3 +1,4 @@
import type { Href } from "expo-router";
import type { WorkspaceDescriptor } from "@/stores/session-store";
import { buildHostNewWorkspaceRoute, buildHostRootRoute } from "@/utils/host-routes";
import { resolveWorkspaceRouteId } from "@/utils/workspace-execution";
@@ -6,7 +7,7 @@ export function buildWorkspaceArchiveRedirectRoute(input: {
serverId: string;
archivedWorkspaceId: string;
workspaces: Iterable<WorkspaceDescriptor>;
}) {
}): Href {
const archivedWorkspaceId = resolveWorkspaceRouteId({
routeWorkspaceId: input.archivedWorkspaceId,
});
@@ -1,3 +1,4 @@
import type { Href } from "expo-router";
import type { ActiveWorkspaceSelection } from "@/stores/navigation-active-workspace-store";
import type { WorkspaceDescriptor } from "@/stores/session-store";
import { buildWorkspaceArchiveRedirectRoute } from "@/utils/workspace-archive-navigation";
@@ -9,7 +10,7 @@ export interface RedirectIfArchivingActiveWorkspaceInput {
}
export interface RedirectIfArchivingActiveWorkspaceDeps {
navigateToRoute: (route: string) => void;
navigateToRoute: (route: Href) => void;
readWorkspaces: (serverId: string) => Iterable<WorkspaceDescriptor>;
}