From 73bc6afa3e2519f5c8cf33962ab48c2dfa8040ac Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Mon, 20 Aug 2018 17:48:14 -0400 Subject: [PATCH 1/3] feat: add publish success notification When a file is confirmed, create a desktop notification with the claim name and ability to click the notification to view the claim --- src/renderer/redux/actions/publish.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index 72926928b..ffe8ca435 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -14,6 +14,8 @@ import type { UpdatePublishFormAction, PublishParams, } from 'redux/reducers/publish'; +import { selectosNotificationsEnabled } from 'redux/selectors/settings'; +import { doNavigate } from 'redux/actions/navigation'; import fs from 'fs'; import path from 'path'; @@ -274,6 +276,19 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getState: GetS }); delete pendingPublishMap[claim.name]; + if (selectosNotificationsEnabled(getState())) { + const notif = new window.Notification('LBRY Publish Complete', { + body: `${claim.name} has been published successfully, click here to view it.` , + silent: false, + }); + notif.onclick = () => { + dispatch( + doNavigate('/show', { + uri: claim.name, + }) + ); + }; + } } }); From 6023b32c275302e57f5e4f7bd292a1462d44a085 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 21 Aug 2018 09:51:35 -0400 Subject: [PATCH 2/3] add title to message --- src/renderer/redux/actions/publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index ffe8ca435..1ab5dcab6 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -278,7 +278,7 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getState: GetS delete pendingPublishMap[claim.name]; if (selectosNotificationsEnabled(getState())) { const notif = new window.Notification('LBRY Publish Complete', { - body: `${claim.name} has been published successfully, click here to view it.` , + body: `${claim.value.stream.metadata.title} has been published to lbry://${claim.name}. Click here to view it` , silent: false, }); notif.onclick = () => { From c15c9e25c6c1265f532b772c2593646ea39d3882 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 21 Aug 2018 11:42:45 -0400 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36bf0221e..8b35537de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,13 +13,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * New viewer for human-readable text files ([#1826](https://github.com/lbryio/lbry-desktop/pull/1826)) * CSV and JSON viewer ([#1410](https://github.com/lbryio/lbry-desktop/pull/1410)) * Recommended content on file viewer page ([#1845](https://github.com/lbryio/lbry-desktop/pull/1845)) + * Desktop notification when publish is completed ([#1892](https://github.com/lbryio/lbry-desktop/pull/1892)) ### Changed * Pass error message from spee.ch API during thumbnail upload ([#1840](https://github.com/lbryio/lbry-desktop/pull/1840)) * Use router pattern for rendering file viewer ([#1544](https://github.com/lbryio/lbry-desktop/pull/1544)) * Missing word "to" added to the Bid Help Text (#1854) * Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858)) - + ### Fixed