feat(custom-widgets): complete Custom JSX v2 (#6390)

This commit is contained in:
Thomas authored and ajnart committed 2026-08-13 19:48:57 +02:00
1 parent 3a1245cbc5
commit acdfcbb18e
416 files changed
+37853 -18066

No files matched your search

+10
View File
@@ -9,3 +9,13 @@ export function cn(...inputs: ClassValue[]) {
export function errorMessage(caught: unknown, fallback: string) {
return caught instanceof Error ? caught.message : fallback;
}
export function oauthErrorMessage(caught: unknown) {
const message = errorMessage(caught, "GitHub sign-in failed");
if (/popup.*block|blocked.*popup/iu.test(message))
return "GitHub sign-in popup was blocked. Allow popups for this site and try again.";
if (/cancel|closed.*popup|popup.*closed/iu.test(message)) return "GitHub sign-in was cancelled before it completed.";
if (/provider|oauth|redirect|callback|client.?id/iu.test(message))
return "GitHub sign-in is not configured correctly on the Workshop server.";
return message;
}