improvement: newly created organization's subscriptions flow improved.
This commit is contained in:
@@ -12,7 +12,6 @@ const ROUTE_TAB_READ: { prefix: string; permission: string }[] = [
|
||||
|
||||
export function hasPermission(org: Organization | null, permission: string): boolean {
|
||||
if (!org) return false;
|
||||
if (org.isOwner) return true;
|
||||
return Boolean(org.permissions?.includes(permission));
|
||||
}
|
||||
|
||||
@@ -33,7 +32,6 @@ export function getRequiredReadPermissionForPath(pathname: string): string | nul
|
||||
/** First dashboard route the user may open (ordered). Fallback: account settings. */
|
||||
export function firstAccessibleDashboardPath(org: Organization | null): string {
|
||||
if (!org) return '/today';
|
||||
if (org.isOwner) return '/today';
|
||||
for (const { prefix, permission } of ROUTE_TAB_READ) {
|
||||
if (hasPermission(org, permission)) return prefix;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user