<template>
  <div class="pa-4">
    <p class="text-body-2 text-medium-emphasis">正在打开全局浏览器…</p>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useGlobalBrowser } from '@/composables/useGlobalBrowser'

const router = useRouter()
const { openPanel, newEmptyTab, tabs } = useGlobalBrowser()

onMounted(() => {
  if (!tabs.value.length) newEmptyTab()
  else openPanel()
  router.replace('/')
})
</script>
