-
Notifications
You must be signed in to change notification settings - Fork 60.6k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.isPermissionGranted() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.then((granted) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!granted) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
ToolsBiome
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 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) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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": [ | ||
{ | ||
|
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.
Committable suggestion