feat: update macOS link opening behavior to allow opening in browser #71

This commit is contained in:
Kuingsmile
2025-07-23 09:59:16 +08:00
parent 954ee010c1
commit c47fc1443b
4 changed files with 17 additions and 4 deletions

2
src-tauri/Cargo.lock generated
View File

@@ -2898,7 +2898,7 @@ dependencies = [
[[package]]
name = "openlist-desktop"
version = "0.5.1"
version = "0.6.0"
dependencies = [
"anyhow",
"base64 0.22.1",

View File

@@ -25,9 +25,13 @@ const navigationItems = computed(() => [
}
])
const isMacOs = computed(() => {
return typeof OS_PLATFORM !== 'undefined' && OS_PLATFORM === 'darwin'
})
const openLink = async (url: string) => {
try {
if (appStore.settings.app.open_links_in_browser) {
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
await TauriAPI.files.urlInBrowser(url)
return
}

View File

@@ -80,6 +80,7 @@ import { ExternalLink, Github, BookOpen, Cloud, Code, Terminal, HelpCircle, Mess
import Card from '../ui/Card.vue'
import { TauriAPI } from '../../api/tauri'
import { useAppStore } from '../../stores/app'
import { computed } from 'vue'
const { t } = useTranslation()
const appStore = useAppStore()
@@ -100,9 +101,13 @@ const openRcloneGitHub = () => {
openLink('https://github.com/rclone/rclone')
}
const isMacOs = computed(() => {
return typeof OS_PLATFORM !== 'undefined' && OS_PLATFORM === 'darwin'
})
const openLink = async (url: string) => {
try {
if (appStore.settings.app.open_links_in_browser) {
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
await TauriAPI.files.urlInBrowser(url)
return
}

View File

@@ -426,9 +426,13 @@ const showNotification = (type: 'success' | 'error', message: string) => {
}, 4000)
}
const isMacOs = computed(() => {
return typeof OS_PLATFORM !== 'undefined' && OS_PLATFORM === 'darwin'
})
const openLink = async (url: string) => {
try {
if (appStore.settings.app.open_links_in_browser) {
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
await TauriAPI.files.urlInBrowser(url)
return
}