feat: clean mask feature and jump version to 3.10.1

This commit is contained in:
Zhang Minghan 2024-03-05 16:33:19 +08:00
parent ebe5afd52c
commit fe9004866f
4 changed files with 22 additions and 6 deletions

View File

@ -8,7 +8,7 @@
},
"package": {
"productName": "chatnio",
"version": "3.10.0"
"version": "3.10.1"
},
"tauri": {
"allowlist": {

View File

@ -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<boolean>(false);
const current = useSelector(selectCurrent);
const mask = useSelector(selectMaskItem);
async function handleDeleteAll(e: React.MouseEvent<HTMLButtonElement>) {
e.preventDefault();
e.stopPropagation();
@ -100,7 +105,11 @@ function SidebarAction({ setOperateConversation }: SidebarActionProps) {
dispatch(closeMarket());
}}
>
<Plus className={`h-4 w-4`} />
{current === -1 && mask ? (
<Paintbrush className={`h-4 w-4`} />
) : (
<Plus className={`h-4 w-4`} />
)}
</Button>
<div className={`grow`} />
<AlertDialog open={removeAll} onOpenChange={setRemoveAll}>
@ -120,9 +129,13 @@ function SidebarAction({ setOperateConversation }: SidebarActionProps) {
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>{t("conversation.cancel")}</AlertDialogCancel>
<AlertDialogAction onClick={handleDeleteAll}>
<Button
variant={`destructive`}
loading={true}
onClick={handleDeleteAll}
>
{t("conversation.delete")}
</AlertDialogAction>
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>

View File

@ -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

View File

@ -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},