cleanup: Don't use substring to check prefix
String.prototype.startsWith() is more idiomatic in that case. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3234>
This commit is contained in:
parent
0586158389
commit
193b6c129e
@ -63,9 +63,9 @@ class FdoNotificationDaemon {
|
||||
|
||||
_iconForNotificationData(icon) {
|
||||
if (icon) {
|
||||
if (icon.substr(0, 7) === 'file://')
|
||||
if (icon.startsWith('file://'))
|
||||
return new Gio.FileIcon({file: Gio.File.new_for_uri(icon)});
|
||||
else if (icon[0] === '/')
|
||||
else if (icon.startsWith('/'))
|
||||
return new Gio.FileIcon({file: Gio.File.new_for_path(icon)});
|
||||
else
|
||||
return new Gio.ThemedIcon({name: icon});
|
||||
|
Loading…
x
Reference in New Issue
Block a user