@@ -19,6 +19,7 @@ import {
1919 WORKSPACE_BROWSER_PREVIEW_EXTENSIONS ,
2020 WORKSPACE_IMAGE_PREVIEW_EXTENSIONS ,
2121} from "@t3tools/shared/filePreview" ;
22+ import { PROJECT_FAVICON_FALLBACK_MARKER } from "@t3tools/shared/projectFavicon" ;
2223import * as Clock from "effect/Clock" ;
2324import * as Effect from "effect/Effect" ;
2425import * as FileSystem from "effect/FileSystem" ;
@@ -40,7 +41,6 @@ import * as ProjectFaviconResolver from "../project/ProjectFaviconResolver.ts";
4041import * as WorkspacePaths from "../workspace/WorkspacePaths.ts" ;
4142
4243export const ASSET_ROUTE_PREFIX = "/api/assets" ;
43- export const FALLBACK_PROJECT_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#6b728080" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-fallback="project-favicon"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2Z"/></svg>` ;
4444
4545const SIGNING_SECRET_NAME = "asset-access-signing-key" ;
4646const ASSET_TOKEN_TTL_MS = 60 * 60 * 1000 ;
@@ -91,9 +91,7 @@ const AssetClaimsJson = Schema.fromJsonString(AssetClaimsSchema);
9191const decodeAssetClaims = Schema . decodeUnknownOption ( AssetClaimsJson ) ;
9292const encodeAssetClaims = Schema . encodeSync ( AssetClaimsJson ) ;
9393
94- export type ResolvedAsset =
95- | { readonly kind : "file" ; readonly path : string }
96- | { readonly kind : "project-favicon-fallback" } ;
94+ export type ResolvedAsset = { readonly kind : "file" ; readonly path : string } ;
9795
9896function decodeClaims ( encodedPayload : string ) : AssetClaims | null {
9997 try {
@@ -326,7 +324,7 @@ export const issueAssetUrl = Effect.fn("AssetAccess.issueAssetUrl")(function* (i
326324 relativePath,
327325 expiresAt,
328326 } ;
329- fileName = relativePath ? path . basename ( relativePath ) : "favicon.svg" ;
327+ fileName = relativePath ? path . basename ( relativePath ) : PROJECT_FAVICON_FALLBACK_MARKER ;
330328 break ;
331329 }
332330 }
@@ -391,9 +389,7 @@ export const resolveAsset = Effect.fn("AssetAccess.resolveAsset")(function* (
391389 }
392390
393391 if ( claims . kind === "project-favicon" ) {
394- if ( claims . relativePath === null ) {
395- return { kind : "project-favicon-fallback" } satisfies ResolvedAsset ;
396- }
392+ if ( claims . relativePath === null ) return null ;
397393 const faviconPath = yield * resolveCanonicalWorkspaceFileForRequest ( {
398394 workspaceRoot : claims . workspaceRoot ,
399395 relativePath : claims . relativePath ,
0 commit comments