network: Fix visibility of VPN section

Commit f2a9467f91 was too eager to simplify the code, and removed
the bits that hid the section in case no VPNs are set up - add them
back to fix the visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=787845
This commit is contained in:
Florian Müllner 2017-12-21 16:51:28 +01:00
parent 64c857e3ff
commit cb2e26ff10

View File

@ -1492,6 +1492,15 @@ var NMVPNSection = new Lang.Class({
this.parent(client);
this.item.menu.addSettingsAction(_("VPN Settings"), 'gnome-network-panel.desktop');
this._sync();
},
_sync: function() {
let nItems = this._connectionItems.size;
this.item.actor.visible = (nItems > 0);
this.parent();
},
_getDescription: function() {