From dbf1f032401391f07997c9922f93725d9964f63e Mon Sep 17 00:00:00 2001 From: nekobato Date: Sun, 20 Aug 2023 18:05:20 +0900 Subject: [PATCH] =?UTF-8?q?settings=E3=81=8B=E3=82=89=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E5=A4=89=E6=9B=B4=20?= =?UTF-8?q?=E5=BE=A9=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/main/db.ts | 12 +- packages/renderer/src/components/Post.vue | 2 - .../Settings/ApplicationSettings.vue | 30 +++-- .../components/Settings/TimelineSettings.vue | 54 +++------ .../src/pages/MainWindow/Settings.vue | 5 +- .../src/pages/MainWindow/Timeline.vue | 111 +---------------- .../renderer/src/pages/MainWindow/index.vue | 112 +++++++++++++++++- packages/renderer/src/store/index.ts | 3 +- packages/renderer/src/store/settings.ts | 4 +- packages/renderer/src/store/timeline.ts | 5 +- 10 files changed, 158 insertions(+), 180 deletions(-) diff --git a/packages/main/db.ts b/packages/main/db.ts index b8aac1e..1008147 100644 --- a/packages/main/db.ts +++ b/packages/main/db.ts @@ -23,8 +23,6 @@ export const upsertUser = async (user: User) => { if (!user.name) throw new Error("name is required"); if (!user.username) throw new Error("username is required"); - console.log("upsertUser", user); - const existingUser = await prisma.user.findFirst({ where: { name: user.name, @@ -60,8 +58,6 @@ export const upsertUser = async (user: User) => { export const deleteUser = async (userId: number) => { if (!userId) throw new Error("userId is required"); - console.log("deleteUser", userId); - return await prisma.user.delete({ where: { id: Number(userId), @@ -73,8 +69,6 @@ export const setSetting = async (key: string, value: string) => { if (!key) throw new Error("key is required"); if (!value) throw new Error("value is required"); - console.log("setSetting", key, value); - return await prisma.settings.upsert({ where: { key: key, @@ -108,14 +102,14 @@ export function setTimeline(data: { id?: number; userId: number; channel: string if (!channel) throw new Error("channel is required"); if (!options) throw new Error("options is required"); - console.log("setTimeline", data); - if (id) { return prisma.timeline.update({ where: { id: id, }, data: { + userId: userId, + channel: channel, options: options, }, }); @@ -152,8 +146,6 @@ export const upsertInstance = async (instance: { if (!url) throw new Error("url is required"); if (!iconUrl) throw new Error("iconUrl is required"); - console.log("upsertInstance", instance); - if (id) { return await prisma.instance.update({ where: { diff --git a/packages/renderer/src/components/Post.vue b/packages/renderer/src/components/Post.vue index 82e16b2..be09c75 100644 --- a/packages/renderer/src/components/Post.vue +++ b/packages/renderer/src/components/Post.vue @@ -15,8 +15,6 @@ const props = defineProps({ }, }); -console.log(props.post.reactions); - const postType = computed(() => { if (props.post.repost) { if (props.post.text) { diff --git a/packages/renderer/src/components/Settings/ApplicationSettings.vue b/packages/renderer/src/components/Settings/ApplicationSettings.vue index f877a0a..e5ea27a 100644 --- a/packages/renderer/src/components/Settings/ApplicationSettings.vue +++ b/packages/renderer/src/components/Settings/ApplicationSettings.vue @@ -8,15 +8,9 @@ import { useStore } from "@/store"; const store = useStore(); const settingsStore = useSettingsStore(); -const opacity = ref(); - -const onChangeOpacity = async () => { - settingsStore.setOpacity(opacity.value); +const onChangeOpacity = async (e: Event) => { + await settingsStore.setOpacity(Number((e.target as HTMLInputElement)?.value)); }; - -onMounted(() => { - opacity.value = store.settings.opacity || 50; -});