Skip to content

Commit

Permalink
fix(notification): use RegExp.prototype.exec() correctly
Browse files Browse the repository at this point in the history
The notification title regular expression was being used incorrectly,
causing it fail if a notification was not from a device.
  • Loading branch information
andyholmes committed Apr 27, 2024
1 parent d19147a commit 45044cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ class Source extends GtkNotificationDaemonAppSource {
this._notificationPending = true;

// valent-modifications-begin
const [match, deviceId, remoteId] = DEVICE_REGEX.exec(notification.id);
if (match) {
const [, deviceId, remoteId] = DEVICE_REGEX.exec(notification.id) ?? [];
if (deviceId && remoteId) {
notification.set({deviceId, remoteId});
notification.connect('destroy', (_notification, reason) => {
this._valentCloseNotification(notification, reason);
Expand Down

0 comments on commit 45044cf

Please sign in to comment.