mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 08:33:36 +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: (
|
new_notification: (
|
||||||
title: string,
|
title: string,
|
||||||
options: NotificationOptions | undefined,
|
options: NotificationOptions,
|
||||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||||
): NotificationData => newNotification(title, options, dispatch),
|
): NotificationData => newNotification(title, options, dispatch),
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ interface CompatElectronBridge extends ElectronBridge {
|
|||||||
const NativeNotification = Notification;
|
const NativeNotification = Notification;
|
||||||
|
|
||||||
class InjectedNotification extends EventTarget {
|
class InjectedNotification extends EventTarget {
|
||||||
constructor(title: string, options?: NotificationOptions) {
|
constructor(title: string, options: NotificationOptions = {}) {
|
||||||
super();
|
super();
|
||||||
Object.assign(
|
Object.assign(
|
||||||
this,
|
this,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export interface NotificationData {
|
|||||||
|
|
||||||
export function newNotification(
|
export function newNotification(
|
||||||
title: string,
|
title: string,
|
||||||
options: NotificationOptions | undefined,
|
options: NotificationOptions,
|
||||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||||
): NotificationData {
|
): NotificationData {
|
||||||
const notification = new DefaultNotification(title, options);
|
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;
|
on_event: (eventName: string, listener: ListenerType) => void;
|
||||||
new_notification: (
|
new_notification: (
|
||||||
title: string,
|
title: string,
|
||||||
options: NotificationOptions | undefined,
|
options: NotificationOptions,
|
||||||
dispatch: (type: string, eventInit: EventInit) => boolean,
|
dispatch: (type: string, eventInit: EventInit) => boolean,
|
||||||
) => NotificationData;
|
) => NotificationData;
|
||||||
get_idle_on_system: () => boolean;
|
get_idle_on_system: () => boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user