-
Notifications
You must be signed in to change notification settings - Fork 60.4k
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
拉取 #4901
Conversation
@QQHKX is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe updates primarily rebrand the application from "ChatGPT Next Web" to "qiqi-GPT 共享平台" across various components and configurations. Text content, UI elements, update notifications, and manifest files have been updated accordingly. Additionally, update handling logic has been removed from the Settings component, simplifying its codebase. Changes
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Your build has completed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- app/components/exporter.tsx (3 hunks)
- app/components/settings.tsx (1 hunks)
- app/components/sidebar.tsx (2 hunks)
- app/constant.ts (1 hunks)
- app/layout.tsx (2 hunks)
- app/locales/cn.ts (2 hunks)
- app/store/update.ts (1 hunks)
- public/site.webmanifest (1 hunks)
- src-tauri/tauri.conf.json (4 hunks)
Files not reviewed due to errors (2)
- app/components/sidebar.tsx (no review received)
- app/locales/cn.ts (no review received)
Files skipped from review due to trivial changes (3)
- app/constant.ts
- public/site.webmanifest
- src-tauri/tauri.conf.json
Additional context used
Biome
app/store/update.ts
[error] 37-43: This else clause can be omitted because previous branches break early.
Unsafe fix: Omit the else clause.
(lint/style/noUselessElse)
[error] 93-121: This else clause can be omitted because previous branches break early.
Unsafe fix: Omit the else clause.
(lint/style/noUselessElse)
app/components/sidebar.tsx
[error] 181-188: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
app/components/exporter.tsx
[error] 97-106: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 165-173: This else clause can be omitted because previous branches break early.
Unsafe fix: Omit the else clause.
(lint/style/noUselessElse)
[error] 169-173: This else clause can be omitted because previous branches break early.
(lint/style/noUselessElse)
[error] 196-196: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 216-216: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 490-490: innerHTML is assigned to itself.
This is where is assigned.
(lint/correctness/noSelfAssign)
[error] 641-642: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
app/components/settings.tsx
[error] 92-92: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 104-104: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 327-327: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 348-348: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 363-363: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 381-381: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 394-394: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 405-405: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 423-423: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 437-437: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 447-447: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 657-657: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 664-667: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
[error] 679-679: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 696-696: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 736-736: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 752-752: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 768-768: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 788-789: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 805-805: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
Additional comments not posted (3)
app/layout.tsx (2)
9-9
: Update metadata title to reflect rebranding.The title in the metadata has been updated to "qiqi-GPT 共享平台" to reflect the new branding.
21-21
: Update appleWebApp title to reflect rebranding.The appleWebApp title in the metadata has been updated to "qiqi-GPT 共享平台" to reflect the new branding.
app/components/exporter.tsx (1)
517-518
: Update titles to reflect rebranding.The main title and subtitle have been updated to "qiqi-GPT 共享平台" and "qiqi为爱发电" respectively.
.isPermissionGranted() | ||
.then((granted) => { | ||
if (!granted) { | ||
return; |
There was a problem hiding this comment.
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.
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", | |
}); | |
} | |
} | |
}); |
}); | ||
} | ||
}); | ||
await window.__TAURI__?.notification |
There was a problem hiding this comment.
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.
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", | |
}); | |
} | |
} | |
}); |
await window.__TAURI__?.notification | ||
.isPermissionGranted() | ||
.then((granted) => { | ||
if (!granted) { |
There was a problem hiding this comment.
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.
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", | |
}); | |
} | |
} | |
}); |
} | ||
}); | ||
await window.__TAURI__?.notification | ||
.isPermissionGranted() |
There was a problem hiding this comment.
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.
.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) => { | ||
if (!granted) { | ||
return; | ||
} else { |
There was a problem hiding this comment.
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.
} 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)
}); | ||
await window.__TAURI__?.notification | ||
.isPermissionGranted() | ||
.then((granted) => { |
There was a problem hiding this comment.
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.
.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", | |
}); | |
} | |
} | |
}); |
Summary by CodeRabbit
New Features
Removed
Bug Fixes
Other Improvements