diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2022-12-15 09:58:34 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2022-12-15 21:55:53 +0100 |
commit | b31bbc73637290a7eaa45c9c4352810ef453ee5d (patch) | |
tree | 55cdf9707695db92fa4dbb8cbe3a1b79aa064a79 /src | |
parent | 5c53f7bd8d56d6f5d0e7a2ddd846b85854e3fac4 (diff) | |
download | gnome-maps-b31bbc73637290a7eaa45c9c4352810ef453ee5d.tar.gz |
placeBar: Don't try to set title for places with no titlewip/mlundblad/dont-format-non-stored-place
Coordinate-only places (e.g. opened from a geo: URI) which
isn't stored in the place store won't have a formattable title,
so don't try use a PlaceFormatter with them.
Diffstat (limited to 'src')
-rw-r--r-- | src/placeBar.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/placeBar.js b/src/placeBar.js index 5ed5d255..1b3e6e13 100644 --- a/src/placeBar.js +++ b/src/placeBar.js @@ -67,8 +67,16 @@ export class PlaceBar extends Gtk.Revealer { return; } - let formatter = new PlaceFormatter(this.place); - this._title.label = formatter.title; + /* set a formatted title when relevant for the place + * e.g. not for pure coordinate-based places (geo: URIs for example) + * which are not stored in the place store + */ + if (this.place.store) { + let formatter = new PlaceFormatter(this.place); + this._title.label = formatter.title; + } else { + this._title.label = ''; + } this._buttons.place = this.place; |