mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 03:31:56 +00:00
electron_bridge: Make the options argument of new_notification required.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -25,7 +25,7 @@ const electron_bridge: ElectronBridge = {
|
||||
|
||||
new_notification: (
|
||||
title: string,
|
||||
options: NotificationOptions | undefined,
|
||||
options: NotificationOptions,
|
||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||
): NotificationData => newNotification(title, options, dispatch),
|
||||
|
||||
|
@@ -69,7 +69,7 @@ interface CompatElectronBridge extends ElectronBridge {
|
||||
const NativeNotification = Notification;
|
||||
|
||||
class InjectedNotification extends EventTarget {
|
||||
constructor(title: string, options?: NotificationOptions) {
|
||||
constructor(title: string, options: NotificationOptions = {}) {
|
||||
super();
|
||||
Object.assign(
|
||||
this,
|
||||
|
@@ -30,7 +30,7 @@ export interface NotificationData {
|
||||
|
||||
export function newNotification(
|
||||
title: string,
|
||||
options: NotificationOptions | undefined,
|
||||
options: NotificationOptions,
|
||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||
): NotificationData {
|
||||
const notification = new DefaultNotification(title, options);
|
||||
|
2
typings.d.ts
vendored
2
typings.d.ts
vendored
@@ -32,7 +32,7 @@ interface ElectronBridge {
|
||||
on_event: (eventName: string, listener: ListenerType) => void;
|
||||
new_notification: (
|
||||
title: string,
|
||||
options: NotificationOptions | undefined,
|
||||
options: NotificationOptions,
|
||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||
) => NotificationData;
|
||||
get_idle_on_system: () => boolean;
|
||||
|
Reference in New Issue
Block a user