From c4f9874e1fdfc069ab699c7a2e25150896de8590 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 28 May 2026 14:29:08 +0700 Subject: [PATCH] Fix archive redirect route typing --- packages/app/src/utils/workspace-archive-navigation.test.ts | 5 +++-- packages/app/src/utils/workspace-archive-navigation.ts | 3 ++- packages/app/src/utils/workspace-archive-redirect.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/app/src/utils/workspace-archive-navigation.test.ts b/packages/app/src/utils/workspace-archive-navigation.test.ts index 7787174f4..ed37fabc7 100644 --- a/packages/app/src/utils/workspace-archive-navigation.test.ts +++ b/packages/app/src/utils/workspace-archive-navigation.test.ts @@ -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: { diff --git a/packages/app/src/utils/workspace-archive-navigation.ts b/packages/app/src/utils/workspace-archive-navigation.ts index b19425c6f..3ca2d22f9 100644 --- a/packages/app/src/utils/workspace-archive-navigation.ts +++ b/packages/app/src/utils/workspace-archive-navigation.ts @@ -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; -}) { +}): Href { const archivedWorkspaceId = resolveWorkspaceRouteId({ routeWorkspaceId: input.archivedWorkspaceId, }); diff --git a/packages/app/src/utils/workspace-archive-redirect.ts b/packages/app/src/utils/workspace-archive-redirect.ts index 0f042bd2d..18ab3f1b0 100644 --- a/packages/app/src/utils/workspace-archive-redirect.ts +++ b/packages/app/src/utils/workspace-archive-redirect.ts @@ -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; }