Skip to content
This repository was archived by the owner on Jan 3, 2026. It is now read-only.

Commit 001dc70

Browse files
authored
Merge pull request #29 from CKylinMC:dev
Publish v1.2.1
2 parents 72d829a + e9e2452 commit 001dc70

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pasteme",
33
"private": true,
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pasteme"
3-
version = "1.2.0"
3+
version = "1.2.1"
44
description = "A simple clipboard manager"
55
authors = ["CKylinMC"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "PasteMe",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"identifier": "in.ckyl.pasteme",
66
"build": {
77
"beforeDevCommand": "yarn dev",

src/App.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
<script setup lang="ts">
22
import { RouterView } from 'vue-router';
3+
import { darkTheme } from 'naive-ui';
4+
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
5+
import type { BuiltInGlobalTheme } from 'naive-ui/es/themes/interface';
6+
7+
const usingTheme = ref<BuiltInGlobalTheme|null>(null);
8+
9+
const isSystemDarkTheme = computed(
10+
() => !!window.matchMedia('(prefers-color-scheme: dark)')?.matches
11+
);
12+
13+
const updateTheme = () => {
14+
usingTheme.value = isSystemDarkTheme.value ? darkTheme : null;
15+
};
16+
17+
onMounted(() => {
18+
updateTheme();
19+
window.matchMedia('(prefers-color-scheme: dark)')
20+
.addEventListener('change', updateTheme);
21+
});
22+
23+
onBeforeUnmount(() => {
24+
window.matchMedia('(prefers-color-scheme: dark)')
25+
.removeEventListener('change', updateTheme);
26+
});
327
</script>
428

529
<template>
6-
<n-config-provider class="size-full !bg-transparent">
30+
<n-config-provider :theme="usingTheme" class="size-full !bg-transparent">
731
<RouterView />
832
</n-config-provider>
933
</template>

src/AppInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const AppInfo = {
2-
version: "1.2.0",
2+
version: "1.2.1",
33
};

0 commit comments

Comments
 (0)