mirror of
https://github.com/OpenListTeam/OpenList-Desktop.git
synced 2025-11-25 11:18:32 +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]]
|
[[package]]
|
||||||
name = "openlist-desktop"
|
name = "openlist-desktop"
|
||||||
version = "0.5.1"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.22.1",
|
"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) => {
|
const openLink = async (url: string) => {
|
||||||
try {
|
try {
|
||||||
if (appStore.settings.app.open_links_in_browser) {
|
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
|
||||||
await TauriAPI.files.urlInBrowser(url)
|
await TauriAPI.files.urlInBrowser(url)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ import { ExternalLink, Github, BookOpen, Cloud, Code, Terminal, HelpCircle, Mess
|
|||||||
import Card from '../ui/Card.vue'
|
import Card from '../ui/Card.vue'
|
||||||
import { TauriAPI } from '../../api/tauri'
|
import { TauriAPI } from '../../api/tauri'
|
||||||
import { useAppStore } from '../../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
@@ -100,9 +101,13 @@ const openRcloneGitHub = () => {
|
|||||||
openLink('https://github.com/rclone/rclone')
|
openLink('https://github.com/rclone/rclone')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMacOs = computed(() => {
|
||||||
|
return typeof OS_PLATFORM !== 'undefined' && OS_PLATFORM === 'darwin'
|
||||||
|
})
|
||||||
|
|
||||||
const openLink = async (url: string) => {
|
const openLink = async (url: string) => {
|
||||||
try {
|
try {
|
||||||
if (appStore.settings.app.open_links_in_browser) {
|
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
|
||||||
await TauriAPI.files.urlInBrowser(url)
|
await TauriAPI.files.urlInBrowser(url)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,9 +426,13 @@ const showNotification = (type: 'success' | 'error', message: string) => {
|
|||||||
}, 4000)
|
}, 4000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMacOs = computed(() => {
|
||||||
|
return typeof OS_PLATFORM !== 'undefined' && OS_PLATFORM === 'darwin'
|
||||||
|
})
|
||||||
|
|
||||||
const openLink = async (url: string) => {
|
const openLink = async (url: string) => {
|
||||||
try {
|
try {
|
||||||
if (appStore.settings.app.open_links_in_browser) {
|
if (appStore.settings.app.open_links_in_browser || isMacOs.value) {
|
||||||
await TauriAPI.files.urlInBrowser(url)
|
await TauriAPI.files.urlInBrowser(url)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user