Skip to content

Commit

Permalink
🎨 改进平台特定代码
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Dec 3, 2024
1 parent cb8abde commit 99cf44b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
8 changes: 3 additions & 5 deletions src/components/AppSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<script setup lang="ts">
import type { OsType } from '@tauri-apps/plugin-os'
import { type as getOsType } from '@tauri-apps/plugin-os'
const osType = inject<OsType>('osType')
const isMacOs = $computed(() => unref(osType) === 'macos')
const osType = getOsType()
</script>

<template>
<aside
class="flex flex-col items-center gap-4 bg-background pb-5"
:class="[
focused ? 'bg-opacity-40 dark:bg-opacity-60' : 'bg-opacity-70 dark:bg-opacity-90',
isMacOs ? 'pt-8 w-18' : 'pt-7 w-15',
osType === 'macos' ? 'pt-8 w-18' : 'pt-7 w-15',
]"
>
<AppLogo class="size-9" />
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppTitlebar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { OsType } from '@tauri-apps/plugin-os'
import { type as getOsType } from '@tauri-apps/plugin-os'
const osType = inject<OsType>('osType')
const osType = getOsType()
</script>

<template>
Expand Down
9 changes: 0 additions & 9 deletions src/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
<script setup lang="ts">
import { type as getOsType } from '@tauri-apps/plugin-os'
import { relaunch } from '@tauri-apps/plugin-process'
import { check } from '@tauri-apps/plugin-updater'
import { configure } from 'vee-validate'
import type { OsType } from '@tauri-apps/plugin-os'
import { isRelease } from '~build/meta'
configure({
validateOnBlur: false,
})
let osType = $ref<OsType>()
provide('osType', $$(osType))
onMounted(async () => {
osType = getOsType()
const general = useGeneralSettingsStore()
await general.startAssetsServer(general.assetsServerAddress)
Expand Down

0 comments on commit 99cf44b

Please sign in to comment.