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

Feat Tauri Notification [Desktop App] [AlwaysOnTop] [UI/UX Chats Page] #106

Merged
merged 1 commit into from
Nov 15, 2023
Merged
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
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