Fix "Source.notify() has been moved to ..."" error

Fix "Source.notify() has been moved to Source.showNotification() this code
will break in the future" error. Note this is done with a check for
showNotification being a function to preserve compatibility with GNOME-3.34.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2020-02-17 20:17:46 +01:00
parent aa682804aa
commit 029b282457

View File

@ -224,8 +224,12 @@ class TeaTime extends PanelMenu.Button {
let notification = new MessageTray.Notification(source, subject, text); let notification = new MessageTray.Notification(source, subject, text);
notification.setTransient(true); notification.setTransient(true);
if (typeof source.showNotification === 'function') {
source.showNotification(notification);
} else {
source.notify(notification); source.notify(notification);
} }
}
_initCountdown(time) { _initCountdown(time) {
this._startTime = new Date(); this._startTime = new Date();