[MM-45780] Update to macos-notification-state 3.0, update entitlements and provisioning profile to allow Communication Notification access (#2972)
* [MM-45780] Update to macos-notification-state 3.0, update entitlements and provisioning profile to allow Communication Notification access * Remove extra entitlements * Add proper inherit
This commit is contained in:
@@ -121,7 +121,7 @@ describe('main/notifications', () => {
|
||||
PermissionsManager.doPermissionRequest.mockReturnValue(Promise.resolve(true));
|
||||
Notification.isSupported.mockImplementation(() => true);
|
||||
getFocusAssist.mockReturnValue({value: 0, name: ''});
|
||||
getDarwinDoNotDisturb.mockReturnValue(false);
|
||||
getDarwinDoNotDisturb.mockReturnValue(Promise.resolve(false));
|
||||
Config.notifications = {
|
||||
flashWindow: 0,
|
||||
bounceIcon: false,
|
||||
@@ -184,7 +184,7 @@ describe('main/notifications', () => {
|
||||
value: 'darwin',
|
||||
});
|
||||
|
||||
getDarwinDoNotDisturb.mockReturnValue(true);
|
||||
getDarwinDoNotDisturb.mockReturnValue(Promise.resolve(true));
|
||||
await NotificationManager.displayMention(
|
||||
'test',
|
||||
'test body',
|
||||
@@ -389,13 +389,13 @@ describe('main/notifications', () => {
|
||||
beforeEach(() => {
|
||||
Notification.isSupported.mockImplementation(() => true);
|
||||
getFocusAssist.mockReturnValue({value: 0, name: ''});
|
||||
getDarwinDoNotDisturb.mockReturnValue(false);
|
||||
getDarwinDoNotDisturb.mockReturnValue(Promise.resolve(false));
|
||||
});
|
||||
|
||||
it('should open file when clicked', () => {
|
||||
getDarwinDoNotDisturb.mockReturnValue(false);
|
||||
it('should open file when clicked', async () => {
|
||||
getDarwinDoNotDisturb.mockReturnValue(Promise.resolve(false));
|
||||
localizeMessage.mockReturnValue('test_filename');
|
||||
NotificationManager.displayDownloadCompleted(
|
||||
await NotificationManager.displayDownloadCompleted(
|
||||
'test_filename',
|
||||
'/path/to/file',
|
||||
'server_name',
|
||||
|
@@ -34,7 +34,7 @@ class NotificationManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getDoNotDisturb()) {
|
||||
if (await getDoNotDisturb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class NotificationManager {
|
||||
mention.show();
|
||||
}
|
||||
|
||||
public displayDownloadCompleted(fileName: string, path: string, serverName: string) {
|
||||
public async displayDownloadCompleted(fileName: string, path: string, serverName: string) {
|
||||
log.debug('displayDownloadCompleted', {fileName, path, serverName});
|
||||
|
||||
if (!Notification.isSupported()) {
|
||||
@@ -110,7 +110,7 @@ class NotificationManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getDoNotDisturb()) {
|
||||
if (await getDoNotDisturb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,12 +136,12 @@ class NotificationManager {
|
||||
download.show();
|
||||
}
|
||||
|
||||
public displayUpgrade(version: string, handleUpgrade: () => void): void {
|
||||
public async displayUpgrade(version: string, handleUpgrade: () => void) {
|
||||
if (!Notification.isSupported()) {
|
||||
log.error('notification not supported');
|
||||
return;
|
||||
}
|
||||
if (getDoNotDisturb()) {
|
||||
if (await getDoNotDisturb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -156,12 +156,12 @@ class NotificationManager {
|
||||
this.upgradeNotification.show();
|
||||
}
|
||||
|
||||
public displayRestartToUpgrade(version: string, handleUpgrade: () => void): void {
|
||||
public async displayRestartToUpgrade(version: string, handleUpgrade: () => void) {
|
||||
if (!Notification.isSupported()) {
|
||||
log.error('notification not supported');
|
||||
return;
|
||||
}
|
||||
if (getDoNotDisturb()) {
|
||||
if (await getDoNotDisturb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class NotificationManager {
|
||||
}
|
||||
}
|
||||
|
||||
function getDoNotDisturb() {
|
||||
async function getDoNotDisturb() {
|
||||
if (process.platform === 'win32') {
|
||||
return getWindowsDoNotDisturb();
|
||||
}
|
||||
|
Reference in New Issue
Block a user