Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

875 B
Raw Blame
import { computed } from 'vue'
import { useRoute } from 'vue-router'

export const useAppRouteInfo = () => {
  const route = useRoute()
  const orgSlug = computed(() => String(route.params.orgSlug || ''))
  const isUserRoute = computed(() => route.name === 'user')
  const isAccountRoute = computed(() => route.name === 'account')
  const isSettingsRoute = computed(() => route.name === 'settings')
  const projectId = computed(() => Number(route.params.projectId) || -1)
  const hasProject = computed(() => projectId.value > 0)
  const listId = computed(() => Number(route.params.listId) || -1)
  const hasList = computed(() => !!route.params.listId)
  const taskId = computed(() => Number(route.params.taskId) || -1)

  return {
    orgSlug,
    isUserRoute,
    isAccountRoute,
    isSettingsRoute,
    hasProject,
    projectId,
    listId,
    hasList,
    taskId,
  }
}