Merge pull request #1892 from lbryio/publish-notification
feat: add publish success notification
This commit is contained in:
commit
dab28339cf
2 changed files with 17 additions and 1 deletions
|
@ -13,6 +13,7 @@ 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))
|
||||
|
|
|
@ -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.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,
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue