Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

513 B
Raw Blame
// Keep pending shares on hold during setup and while editing app preferences.
// Opening app settings must not bypass server selection or authentication.
const holdPathPrefixes = ['/auth', '/config', '/organizations/create', '/app-settings'];

export function shouldRedirectShareIntent({
  hasShareIntent,
  pathname,
}: {
  hasShareIntent: boolean;
  pathname: string;
}) {
  return (
    hasShareIntent &&
    pathname !== '/share' &&
    !holdPathPrefixes.some((prefix) => pathname.startsWith(prefix))
  );
}