fix: TypeScript build errors — router params, tinykeys types, thread_id field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6375abf2d8
commit
73391e0b07
|
|
@ -36,6 +36,7 @@ export type Thread = {
|
||||||
export type MessageSummary = {
|
export type MessageSummary = {
|
||||||
id: string;
|
id: string;
|
||||||
folder_id: string;
|
folder_id: string;
|
||||||
|
thread_id: string | null;
|
||||||
from_addr: Address;
|
from_addr: Address;
|
||||||
to_addrs: Address[];
|
to_addrs: Address[];
|
||||||
cc_addrs: Address[];
|
cc_addrs: Address[];
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Outlet, useNavigate } from '@tanstack/react-router';
|
import { Outlet, useNavigate } from '@tanstack/react-router';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
// @ts-expect-error — tinykeys has no bundled .d.ts for its ESM export path
|
||||||
import { tinykeys } from 'tinykeys';
|
import { tinykeys } from 'tinykeys';
|
||||||
import { api } from '@/api/client';
|
import { api } from '@/api/client';
|
||||||
import { useUI } from '@/store/ui';
|
import { useUI } from '@/store/ui';
|
||||||
|
|
@ -30,15 +31,18 @@ export function AppShell() {
|
||||||
|
|
||||||
// Global keyboard shortcuts
|
// Global keyboard shortcuts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const nav = (folderId: string) => () =>
|
||||||
|
navigate({ to: '/f/$folderId', params: { folderId } });
|
||||||
|
|
||||||
return tinykeys(window, {
|
return tinykeys(window, {
|
||||||
c: (e) => { if (!isComposeOpen && !isInput(e.target)) openCompose(); },
|
c: (e: Event) => { if (!isComposeOpen && !isInput((e as KeyboardEvent).target)) openCompose(); },
|
||||||
'/': (e) => { if (!isInput(e.target)) { e.preventDefault(); document.getElementById('search-input')?.focus(); } },
|
'/': (e: Event) => { if (!isInput((e as KeyboardEvent).target)) { e.preventDefault(); document.getElementById('search-input')?.focus(); } },
|
||||||
Escape: () => closeCompose(),
|
Escape: () => closeCompose(),
|
||||||
'g i': () => navigate({ to: '/f/inbox' }),
|
'g i': nav('inbox'),
|
||||||
'g s': () => navigate({ to: '/f/sent' }),
|
'g s': nav('sent'),
|
||||||
'g d': () => navigate({ to: '/f/drafts' }),
|
'g d': nav('drafts'),
|
||||||
'g e': () => navigate({ to: '/f/archive' }),
|
'g e': nav('archive'),
|
||||||
'g t': () => navigate({ to: '/f/trash' }),
|
'g t': nav('trash'),
|
||||||
});
|
});
|
||||||
}, [isComposeOpen, navigate, openCompose, closeCompose]);
|
}, [isComposeOpen, navigate, openCompose, closeCompose]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const rootRoute = createRootRoute({ component: AppShell });
|
||||||
const indexRoute = createRoute({
|
const indexRoute = createRoute({
|
||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: '/',
|
path: '/',
|
||||||
beforeLoad: () => { throw redirect({ to: '/f/inbox' }); },
|
beforeLoad: () => { throw redirect({ to: '/f/$folderId', params: { folderId: 'inbox' } }); },
|
||||||
});
|
});
|
||||||
|
|
||||||
const folderRoute = createRoute({
|
const folderRoute = createRoute({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue