Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Feat Tauri Notification [Desktop App] [AlwaysOnTop] [UI/UX Chats Page] (
Browse files Browse the repository at this point in the history
#106)

[+] feat(chat.tsx): add support for pinning and unpinning the app window
[+] feat(chat.tsx): show notification when app window is pinned or unpinned
  • Loading branch information
H0llyW00dzZ authored Nov 15, 2023
1 parent 82d6cf0 commit 5456a3b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import AutoIcon from "../icons/auto.svg";
import BottomIcon from "../icons/bottom.svg";
import StopIcon from "../icons/pause.svg";
import RobotIcon from "../icons/robot.svg";
import ChatGptIcon from "../icons/chatgpt.png";
import EyeOnIcon from "../icons/eye.svg";
import EyeOffIcon from "../icons/eye-off.svg";
import { escapeRegExp } from "lodash";
Expand Down Expand Up @@ -691,9 +692,21 @@ function usePinApp() {
const togglePinApp = async () => {
if (pinApp) {
await appWindow.setAlwaysOnTop(false);
window.__TAURI__?.notification.sendNotification({
title: "ChatGPT Next Web",
body: Locale.Chat.Actions.PinAppContent.UnPinned,
icon: `${ChatGptIcon.src}`,
sound: "Default"
});
showToast(Locale.Chat.Actions.PinAppContent.UnPinned);
} else {
await appWindow.setAlwaysOnTop(true);
window.__TAURI__?.notification.sendNotification({
title: "ChatGPT Next Web",
body: Locale.Chat.Actions.PinAppContent.Pinned,
icon: `${ChatGptIcon.src}`,
sound: "Default"
});
showToast(Locale.Chat.Actions.PinAppContent.Pinned);
}
setPinApp(!pinApp);
Expand Down

0 comments on commit 5456a3b

Please sign in to comment.