Merge pull request #1892 from lbryio/publish-notification

feat: add publish success notification
This commit is contained in:
Sean Yesmunt 2018-08-21 16:23:12 -04:00 committed by GitHub
commit dab28339cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -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)) * 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)) * 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)) * 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 ### Changed
* Pass error message from spee.ch API during thumbnail upload ([#1840](https://github.com/lbryio/lbry-desktop/pull/1840)) * 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)) * 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) * Missing word "to" added to the Bid Help Text (#1854)
* Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858)) * Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858))
### Fixed ### Fixed

View file

@ -14,6 +14,8 @@ import type {
UpdatePublishFormAction, UpdatePublishFormAction,
PublishParams, PublishParams,
} from 'redux/reducers/publish'; } from 'redux/reducers/publish';
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
import { doNavigate } from 'redux/actions/navigation';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
@ -274,6 +276,19 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getState: GetS
}); });
delete pendingPublishMap[claim.name]; delete pendingPublishMap[claim.name];
if (selectosNotificationsEnabled(getState())) {
const notif = new window.Notification('LBRY Publish Complete', {
body: `${claim.value.stream.metadata.title} has been published to lbry://${claim.name}. Click here to view it` ,
silent: false,
});
notif.onclick = () => {
dispatch(
doNavigate('/show', {
uri: claim.name,
})
);
};
}
} }
}); });