mirror of
https://github.com/ivabus/gui
synced 2025-04-23 05:57:11 +03:00
open package page if notification is clicked (#599)
Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
parent
81527f2dbc
commit
5cbe8cade5
1 changed files with 10 additions and 4 deletions
|
@ -2,7 +2,7 @@ import Pushy from "pushy-electron";
|
|||
import { readSessionData } from "./auth";
|
||||
import { post } from "./v1-client";
|
||||
import log from "./logger";
|
||||
import { Notification, BrowserWindow } from "electron";
|
||||
import { Notification, BrowserWindow, shell } from "electron";
|
||||
import { isInstalled, nameToSlug } from "./package";
|
||||
import {
|
||||
getInstalledPackages,
|
||||
|
@ -46,10 +46,16 @@ export default function initialize(mainWindow: BrowserWindow) {
|
|||
const installed = isInstalled(pkg);
|
||||
const isDup = await wasReceivedBefore(data);
|
||||
if (!isDup && installed) {
|
||||
new Notification({
|
||||
const notification = new Notification({
|
||||
title: "tea",
|
||||
body: data?.message as string
|
||||
}).show();
|
||||
body: data?.message as string,
|
||||
actions: [{ type: "button", text: "Open" }]
|
||||
});
|
||||
notification.on("click", () => {
|
||||
shell.openExternal(data?.url);
|
||||
});
|
||||
notification.show();
|
||||
log.info("notification shown", data);
|
||||
|
||||
const v = app.dock.getBadge();
|
||||
if (!v) {
|
||||
|
|
Loading…
Reference in a new issue