From fe9004866fbc452e5ce33bbd4016cecdc3672695 Mon Sep 17 00:00:00 2001 From: Zhang Minghan Date: Tue, 5 Mar 2024 16:33:19 +0800 Subject: [PATCH] feat: clean mask feature and jump version to `3.10.1` --- app/src-tauri/tauri.conf.json | 2 +- app/src/components/home/SideBar.tsx | 19 ++++++++++++++++--- app/src/conf/bootstrap.ts | 2 +- globals/sql.go | 5 ++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 643b80d..d033588 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "chatnio", - "version": "3.10.0" + "version": "3.10.1" }, "tauri": { "allowlist": { diff --git a/app/src/components/home/SideBar.tsx b/app/src/components/home/SideBar.tsx index cdb9e65..c28286a 100644 --- a/app/src/components/home/SideBar.tsx +++ b/app/src/components/home/SideBar.tsx @@ -5,6 +5,7 @@ import { closeMarket, selectCurrent, selectHistory, + selectMaskItem, useConversationActions, } from "@/store/chat.ts"; import React, { useRef, useState } from "react"; @@ -21,6 +22,7 @@ import { Eraser, LogIn, MoreHorizontal, + Paintbrush, Plus, RotateCw, } from "lucide-react"; @@ -70,6 +72,9 @@ function SidebarAction({ setOperateConversation }: SidebarActionProps) { const refreshRef = useRef(null); const [removeAll, setRemoveAll] = useState(false); + const current = useSelector(selectCurrent); + const mask = useSelector(selectMaskItem); + async function handleDeleteAll(e: React.MouseEvent) { e.preventDefault(); e.stopPropagation(); @@ -100,7 +105,11 @@ function SidebarAction({ setOperateConversation }: SidebarActionProps) { dispatch(closeMarket()); }} > - + {current === -1 && mask ? ( + + ) : ( + + )}
@@ -120,9 +129,13 @@ function SidebarAction({ setOperateConversation }: SidebarActionProps) { {t("conversation.cancel")} - + diff --git a/app/src/conf/bootstrap.ts b/app/src/conf/bootstrap.ts index c2af35b..31cdcb1 100644 --- a/app/src/conf/bootstrap.ts +++ b/app/src/conf/bootstrap.ts @@ -7,7 +7,7 @@ import { import { syncSiteInfo } from "@/admin/api/info.ts"; import { setAxiosConfig } from "@/conf/api.ts"; -export const version = "3.10.0"; // version of the current build +export const version = "3.10.1"; // version of the current build export const dev: boolean = getDev(); // is in development mode (for debugging, in localhost origin) export const deploy: boolean = true; // is production environment (for api endpoint) export const tokenField = getTokenField(deploy); // token field name for storing token diff --git a/globals/sql.go b/globals/sql.go index 451ee33..9ed1194 100644 --- a/globals/sql.go +++ b/globals/sql.go @@ -27,6 +27,9 @@ func batchReplace(sql string, batch []batch) string { } func PreflightSql(sql string) string { + // this is a simple way to adapt the sql to the sqlite engine + // it's not a common way to use sqlite in production, just as polyfill + if SqliteEngine { if strings.Contains(sql, "DUPLICATE KEY") { sql = batchReplace(sql, []batch{ @@ -57,7 +60,7 @@ func PreflightSql(sql string) string { }, }) } - + sql = batchReplace(sql, []batch{ // KEYWORD REPLACEMENT {`INT `, `INTEGER `, false},