Fix notification clicks preserving workspace deck

This commit is contained in:
Mohamed Boudra
2026-04-21 21:57:15 +07:00
parent 8dad423635
commit 73b28a7f60
3 changed files with 71 additions and 6 deletions
@@ -1,3 +1,4 @@
import type { Href } from "expo-router";
import {
buildHostAgentDetailRoute,
buildHostRootRoute,
@@ -5,6 +6,7 @@ import {
} from "@/utils/host-routes";
type NotificationData = Record<string, unknown> | null | undefined;
type NotificationRoute = Extract<Href, string>;
function readNonEmptyString(data: NotificationData, key: string): string | null {
const value = data?.[key];
@@ -27,7 +29,7 @@ export function resolveNotificationTarget(data: NotificationData): {
};
}
export function buildNotificationRoute(data: NotificationData) {
export function buildNotificationRoute(data: NotificationData): NotificationRoute {
const { serverId, agentId, workspaceId } = resolveNotificationTarget(data);
if (serverId && agentId) {
if (workspaceId) {