KI-AGENT: Terminpicker und Dokumentaufruf verbessert
This commit is contained in:
9
mobile/src/lib/file-opening.ts
Normal file
9
mobile/src/lib/file-opening.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { getApiBaseUrlSync } from '@/src/lib/server-config';
|
||||
|
||||
export function getOpenableFileUrl(rawUrl: string): string {
|
||||
if (/^https?:\/\//i.test(rawUrl)) return rawUrl;
|
||||
|
||||
const apiBaseUrl = getApiBaseUrlSync().replace(/\/+$/, '');
|
||||
const path = rawUrl.startsWith('/') ? rawUrl : `/${rawUrl}`;
|
||||
return `${apiBaseUrl}${path}`;
|
||||
}
|
||||
Reference in New Issue
Block a user