mirror of
https://github.com/desktop/desktop
synced 2024-08-24 18:57:33 +00:00
Merge pull request #13834 from desktop/notifications-only-win10
Use `desktop-notifications` only on Windows 10 and 11
This commit is contained in:
commit
ce61383307
|
@ -26,7 +26,7 @@
|
|||
"codemirror-mode-elixir": "^1.1.2",
|
||||
"compare-versions": "^3.6.0",
|
||||
"deep-equal": "^1.0.1",
|
||||
"desktop-notifications": "^0.1.4",
|
||||
"desktop-notifications": "^0.1.6",
|
||||
"desktop-trampoline": "desktop/desktop-trampoline#v0.9.8",
|
||||
"detect-arm64-translation": "https://github.com/desktop/node-detect-arm64-translation#v1.0.4",
|
||||
"dexie": "^2.0.0",
|
||||
|
|
|
@ -2,6 +2,7 @@ import { focusWindow } from '../../../ui/main-process-proxy'
|
|||
import {
|
||||
DesktopNotification,
|
||||
initializeNotifications,
|
||||
supportsNotifications,
|
||||
} from 'desktop-notifications'
|
||||
import { findToastActivatorClsid } from '../../find-toast-activator-clsid'
|
||||
|
||||
|
@ -37,7 +38,7 @@ export function showNotification(
|
|||
body: string,
|
||||
onClick: () => void
|
||||
) {
|
||||
if (__WIN32__) {
|
||||
if (supportsNotifications()) {
|
||||
initializeWindowsNotifications()
|
||||
|
||||
const notification = new DesktopNotification(title, body)
|
||||
|
|
|
@ -540,10 +540,6 @@ export function buildDefaultMenu({
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Show notification',
|
||||
click: emit('test-show-notification'),
|
||||
},
|
||||
{
|
||||
label: 'Prune branches',
|
||||
click: emit('test-prune-branches'),
|
||||
|
@ -551,6 +547,13 @@ export function buildDefaultMenu({
|
|||
)
|
||||
}
|
||||
|
||||
if (__RELEASE_CHANNEL__ === 'development' || __RELEASE_CHANNEL__ === 'test') {
|
||||
helpItems.push({
|
||||
label: 'Show notification',
|
||||
click: emit('test-show-notification'),
|
||||
})
|
||||
}
|
||||
|
||||
if (__DARWIN__) {
|
||||
template.push({
|
||||
role: 'help',
|
||||
|
|
|
@ -484,7 +484,10 @@ export class App extends React.Component<IAppProps, IAppState> {
|
|||
}
|
||||
|
||||
private testShowNotification() {
|
||||
if (!__DEV__) {
|
||||
if (
|
||||
__RELEASE_CHANNEL__ !== 'development' &&
|
||||
__RELEASE_CHANNEL__ !== 'test'
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -333,13 +333,14 @@ delegates@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||
|
||||
desktop-notifications@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.1.4.tgz#698c5822fb88d7a2289f36b4f64eaac8b5bdefed"
|
||||
integrity sha512-3ADhNvqL9ISbN17x/hWcYUcGHvWJxPnoxxsQbmrU26wpk2eakvDplCm0fvNIpHx/Ar5O7n1VmMOVmLr8W6B8sQ==
|
||||
desktop-notifications@^0.1.6:
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.1.6.tgz#a9bd2774b3385019f849801c5314dbc43af11433"
|
||||
integrity sha512-wIMhqmm2LVxs9+utPb2LtFzrts7SFl99ZLhU0Wy9F41IyTcGNMrutP6o/MUSGBVjSI8HpqjO5NwvqohpEUd+EQ==
|
||||
dependencies:
|
||||
node-addon-api "^4.3.0"
|
||||
prebuild-install "^7.0.1"
|
||||
quick-lru "^3.0.0"
|
||||
uuid "^8.3.2"
|
||||
|
||||
desktop-trampoline@desktop/desktop-trampoline#v0.9.8:
|
||||
|
|
Loading…
Reference in a new issue