feat: custom org brand color (#474)
* feat: add package * feat: add a new color picker * feat: integrate with supabase * feat: add translation * run translation script * feat: hover state * quick fix * fix: requested PR fixes * update lock * ux improvements * remove log * cleanup and improve code --------- Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
co-authored by
Rotimi Best
parent
1ee02cdf3a
commit
947181a3c5
@@ -0,0 +1,14 @@
|
||||
export function tc<T>(tryFunc: () => T, catchFunc: T | ((e?: Error) => T)) {
|
||||
let val: T;
|
||||
try {
|
||||
val = tryFunc();
|
||||
} catch (e: unknown) {
|
||||
if (typeof catchFunc === 'function') {
|
||||
// @ts-ignore
|
||||
val = catchFunc(e);
|
||||
} else {
|
||||
val = catchFunc;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
Reference in New Issue
Block a user