use isDesktop

This commit is contained in:
bymyself
2025-12-11 04:15:43 -08:00
parent aab9a30511
commit 91db13909f
28 changed files with 117 additions and 97 deletions

View File

@@ -4,11 +4,10 @@ import { useI18n } from 'vue-i18n'
import { useCurrentUser } from '@/composables/auth/useCurrentUser'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import { isCloud } from '@/platform/distribution/types'
import { isCloud, isDesktop } from '@/platform/distribution/types'
import type { SettingTreeNode } from '@/platform/settings/settingStore'
import { useSettingStore } from '@/platform/settings/settingStore'
import type { SettingParams } from '@/platform/settings/types'
import { isElectron } from '@/utils/envUtil'
import { normalizeI18nKey } from '@/utils/formatUtil'
import { buildTree } from '@/utils/treeUtil'
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
@@ -161,7 +160,7 @@ export function useSettingUI(
userPanel,
keybindingPanel,
extensionPanel,
...(isElectron() ? [serverConfigPanel] : []),
...(isDesktop ? [serverConfigPanel] : []),
...(shouldShowPlanCreditsPanel.value && subscriptionPanel
? [subscriptionPanel]
: [])
@@ -221,7 +220,7 @@ export function useSettingUI(
keybindingPanel.node,
extensionPanel.node,
aboutPanel.node,
...(isElectron() ? [serverConfigPanel.node] : [])
...(isDesktop ? [serverConfigPanel.node] : [])
].map(translateCategory)
}
])

View File

@@ -3,10 +3,9 @@ import { defineStore } from 'pinia'
import { compare, valid } from 'semver'
import { computed, ref } from 'vue'
import { isCloud } from '@/platform/distribution/types'
import { isCloud, isDesktop } from '@/platform/distribution/types'
import { useSettingStore } from '@/platform/settings/settingStore'
import { useSystemStatsStore } from '@/stores/systemStatsStore'
import { isElectron } from '@/utils/envUtil'
import { stringToLocale } from '@/utils/formatUtil'
import { useReleaseService } from './releaseService'
@@ -95,7 +94,7 @@ export const useReleaseStore = defineStore('release', () => {
// Show toast if needed
const shouldShowToast = computed(() => {
// Only show on desktop version
if (!isElectron() || isCloud) {
if (!isDesktop || isCloud) {
return false
}
@@ -127,7 +126,7 @@ export const useReleaseStore = defineStore('release', () => {
// Show red-dot indicator
const shouldShowRedDot = computed(() => {
// Only show on desktop version
if (!isElectron() || isCloud) {
if (!isDesktop || isCloud) {
return false
}
@@ -172,7 +171,7 @@ export const useReleaseStore = defineStore('release', () => {
})
const shouldShowPopup = computed(() => {
if (!isElectron() && !isCloud) {
if (!isDesktop && !isCloud) {
return false
}