accessDialog: Don't add an empty body

According to the org.freedesktop.impl.portal.Access documentation
the body may be an empty string[1]. Take into account this case.

[1] d7cfc16a6d/data/org.freedesktop.impl.portal.Access.xml (L38)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2607>
This commit is contained in:
Alessandro Bono 2023-01-16 21:41:24 +01:00 committed by Marge Bot
parent ad0dc55c07
commit 771b3bada2

View File

@ -58,6 +58,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
this._choices.set(id, check); this._choices.set(id, check);
} }
if (body) {
let bodyLabel = new St.Label({ let bodyLabel = new St.Label({
text: body, text: body,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
@ -65,6 +66,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
bodyLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; bodyLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
bodyLabel.clutter_text.line_wrap = true; bodyLabel.clutter_text.line_wrap = true;
content.add_child(bodyLabel); content.add_child(bodyLabel);
}
this.addButton({ this.addButton({
label: denyLabel, label: denyLabel,