Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

拉取 #4901

Closed
wants to merge 1 commit into from
Closed

拉取 #4901

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions app/components/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,13 @@ export function ImagePreviewer(props: {
showToast(Locale.Export.Image.Toast);
const dom = previewRef.current;
if (!dom) return;

const isApp = getClientConfig()?.isApp;

try {
const blob = await toPng(dom);
if (!blob) return;

if (isMobile || (isApp && window.__TAURI__)) {
if (isApp && window.__TAURI__) {
const result = await window.__TAURI__.dialog.save({
Expand All @@ -459,7 +459,7 @@ export function ImagePreviewer(props: {
},
],
});

if (result !== null) {
const response = await fetch(blob);
const buffer = await response.arrayBuffer();
Expand Down Expand Up @@ -514,10 +514,8 @@ export function ImagePreviewer(props: {
</div>

<div>
<div className={styles["main-title"]}>ChatGPT Next Web</div>
<div className={styles["sub-title"]}>
github.com/Yidadaa/ChatGPT-Next-Web
</div>
<div className={styles["main-title"]}>qiqi-GPT 共享平台</div>
<div className={styles["sub-title"]}>qiqi为爱发电</div>
<div className={styles["icons"]}>
<ExportAvatar avatar={config.avatar} />
<span className={styles["icon-space"]}>&</span>
Expand Down
25 changes: 0 additions & 25 deletions app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -670,31 +670,6 @@ export function Settings() {
</Popover>
</ListItem>

<ListItem
title={Locale.Settings.Update.Version(currentVersion ?? "unknown")}
subTitle={
checkingUpdate
? Locale.Settings.Update.IsChecking
: hasNewVersion
? Locale.Settings.Update.FoundUpdate(remoteId ?? "ERROR")
: Locale.Settings.Update.IsLatest
}
>
{checkingUpdate ? (
<LoadingIcon />
) : hasNewVersion ? (
<Link href={updateUrl} target="_blank" className="link">
{Locale.Settings.Update.GoToUpdate}
</Link>
) : (
<IconButton
icon={<ResetIcon></ResetIcon>}
text={Locale.Settings.Update.CheckUpdate}
onClick={() => checkUpdate(true)}
/>
)}
</ListItem>

<ListItem title={Locale.Settings.SendKey}>
<Select
value={config.submitKey}
Expand Down
7 changes: 3 additions & 4 deletions app/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ export function SideBar(props: { className?: string }) {
>
<div className={styles["sidebar-header"]} data-tauri-drag-region>
<div className={styles["sidebar-title"]} data-tauri-drag-region>
ChatGPT Next
</div>
<div className={styles["sidebar-sub-title"]}>
Build your own AI assistant.
qiqi-GPT
</div>
<div className={styles["sidebar-sub-title"]}>qiqi为爱发电</div>
<div className={styles["sidebar-logo"] + " no-dark"}>
<ChatGptIcon />
</div>
Expand All @@ -169,6 +167,7 @@ export function SideBar(props: { className?: string }) {
}}
shadow
/>
{/* 魔改 */}
<IconButton
icon={<PluginIcon />}
text={shouldNarrow ? undefined : Locale.Plugin.Name}
Expand Down
2 changes: 1 addition & 1 deletion app/constant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const OWNER = "Yidadaa";
export const REPO = "ChatGPT-Next-Web";
export const REPO_URL = `https://github.com/${OWNER}/${REPO}`;
export const REPO_URL = `https://www.baidu.com`; //魔改
export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`;
export const UPDATE_URL = `${REPO_URL}#keep-updated`;
export const RELEASE_URL = `${REPO_URL}/releases`;
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getClientConfig } from "./config/client";
import { type Metadata } from "next";

export const metadata: Metadata = {
title: "ChatGPT Next Web",
title: "qiqi-GPT 共享平台",
description: "Your personal ChatGPT Chat Bot.",
viewport: {
width: "device-width",
Expand All @@ -18,7 +18,7 @@ export const metadata: Metadata = {
{ media: "(prefers-color-scheme: dark)", color: "#151515" },
],
appleWebApp: {
title: "ChatGPT Next Web",
title: "qiqi-GPT 共享平台",
statusBarStyle: "default",
},
};
Expand Down
8 changes: 4 additions & 4 deletions app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { SubmitKey } from "../store/config";
const isApp = !!getClientConfig()?.isApp;

const cn = {
WIP: "该功能仍在开发中……",
WIP: "加qiqi微信", //魔改
Error: {
Unauthorized: isApp
? "检测到无效 API Key,请前往[设置](/#/settings)页检查 API Key 是否配置正确。"
: "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。",
},
Auth: {
Title: "需要密码",
Tips: "管理员开启了密码验证,请在下方填入访问码",
Title: "找qiqi要密码",
Tips: "qiqi需要密码哦~",
SubTips: "或者输入你的 OpenAI API 密钥",
Input: "在此处填写访问码",
Confirm: "确认",
Expand Down Expand Up @@ -336,7 +336,7 @@ const cn = {
Revert: "恢复上下文",
},
Plugin: {
Name: "插件",
Name: "获取密码", //魔改
},
FineTuned: {
Sysmessage: "你是一个助手",
Expand Down
63 changes: 34 additions & 29 deletions app/store/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,35 +85,40 @@ export const useUpdateStore = createPersistStore(
}));
if (window.__TAURI__?.notification && isApp) {
// Check if notification permission is granted
await window.__TAURI__?.notification.isPermissionGranted().then((granted) => {
if (!granted) {
return;
} else {
// Request permission to show notifications
window.__TAURI__?.notification.requestPermission().then((permission) => {
if (permission === 'granted') {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "ChatGPT Next Web",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default"
});
} else {
const updateMessage = Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "ChatGPT Next Web",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default"
});
}
}
});
}
});
await window.__TAURI__?.notification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await window.__TAURI__?.notification
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});

.isPermissionGranted()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.isPermissionGranted()
.isPermissionGranted()
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});

.then((granted) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.then((granted) => {
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});

if (!granted) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!granted) {
if (!granted) {
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});

return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return;
return;
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});

} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary else clause.

The else clause can be omitted because the previous branch already returns early.

-              } else {
-                // Request permission to show notifications
-                window.__TAURI__?.notification
-                  .requestPermission()
-                  .then((permission) => {
-                    if (permission === "granted") {
-                      if (version === remoteId) {
-                        // Show a notification using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: `${Locale.Settings.Update.IsLatest}`,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      } else {
-                        const updateMessage =
-                          Locale.Settings.Update.FoundUpdate(`${remoteId}`);
-                        // Show a notification for the new version using Tauri
-                        window.__TAURI__?.notification.sendNotification({
-                          title: "qiqi-GPT 共享平台",
-                          body: updateMessage,
-                          icon: `${ChatGptIcon.src}`,
-                          sound: "Default",
-                        });
-                      }
-                    }
-                  });
-              }
+              }
+              // Request permission to show notifications
+              window.__TAURI__?.notification
+                .requestPermission()
+                .then((permission) => {
+                  if (permission === "granted") {
+                    if (version === remoteId) {
+                      // Show a notification using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: `${Locale.Settings.Update.IsLatest}`,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    } else {
+                      const updateMessage =
+                        Locale.Settings.Update.FoundUpdate(`${remoteId}`);
+                      // Show a notification for the new version using Tauri
+                      window.__TAURI__?.notification.sendNotification({
+                        title: "qiqi-GPT 共享平台",
+                        body: updateMessage,
+                        icon: `${ChatGptIcon.src}`,
+                        sound: "Default",
+                      });
+                    }
+                  }
+                });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} else {
}
// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});
Tools
Biome

[error] 93-121: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)

// Request permission to show notifications
window.__TAURI__?.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
} else {
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
title: "qiqi-GPT 共享平台",
body: updateMessage,
icon: `${ChatGptIcon.src}`,
sound: "Default",
});
}
}
});
}
});
}
console.log("[Got Upstream] ", remoteId);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ChatGPT Next Web",
"name": "qiqi-GPT 共享平台",
"short_name": "ChatGPT",
"icons": [
{
Expand Down
8 changes: 4 additions & 4 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"withGlobalTauri": true
},
"package": {
"productName": "ChatGPT Next Web",
"productName": "qiqi-GPT 共享平台",
"version": "2.9.9"
},
"tauri": {
Expand Down Expand Up @@ -68,7 +68,7 @@
"icons/icon.ico"
],
"identifier": "com.yida.chatgpt.next.web",
"longDescription": "ChatGPT Next Web is a cross-platform ChatGPT client, including Web/Win/Linux/OSX/PWA.",
"longDescription": "qiqi-GPT 共享平台 is a cross-platform ChatGPT client, including Web/Win/Linux/OSX/PWA.",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
Expand All @@ -77,7 +77,7 @@
"signingIdentity": null
},
"resources": [],
"shortDescription": "ChatGPT Next Web App",
"shortDescription": "qiqi-GPT 共享平台 App",
"targets": "all",
"windows": {
"certificateThumbprint": null,
Expand All @@ -104,7 +104,7 @@
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "ChatGPT Next Web",
"title": "qiqi-GPT 共享平台",
"width": 960,
"hiddenTitle": true,
"titleBarStyle": "Overlay"
Expand Down
Loading