mirror of
https://github.com/OpenListTeam/OpenList-Desktop.git
synced 2025-11-25 03:14:56 +08:00
feat: update macOS link opening behavior to allow opening in browser #71
This commit is contained in:
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -2898,7 +2898,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openlist-desktop"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user