Skip to content

Commit d3fc6f0

Browse files
committed
chore: Untitled Note for empty
1 parent 4506070 commit d3fc6f0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/window.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,18 @@ export class Window extends Adw.ApplicationWindow {
9898
this.default_width = note.width;
9999
this.default_height = note.height;
100100

101-
this.note.bind_property(
101+
this.note.bind_property_full(
102102
"title",
103103
this,
104104
"title",
105-
GObject.BindingFlags.SYNC_CREATE
105+
GObject.BindingFlags.SYNC_CREATE,
106+
(_, title) => {
107+
if (!title) {
108+
return [true, "Untitled Note"];
109+
}
110+
return [true, title];
111+
},
112+
null
106113
);
107114

108115
this.connect("close-request", () => {

0 commit comments

Comments
 (0)