mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-02 04:01:43 +02:00
core: do not allow empty titles
This commit is contained in:
@@ -145,8 +145,7 @@ export class Notes implements ICollection {
|
||||
const currentNoteTitleFields = await this.db
|
||||
.sql()
|
||||
.selectFrom("notes")
|
||||
.select("isGeneratedTitle")
|
||||
.select("title")
|
||||
.select(["isGeneratedTitle", "title"])
|
||||
.where("id", "=", id)
|
||||
.executeTakeFirst();
|
||||
if (isUpdating) {
|
||||
@@ -162,7 +161,8 @@ export class Notes implements ICollection {
|
||||
currentNoteTitleFields?.title !== headlineTitle
|
||||
) {
|
||||
item.title = titleFormat.replace(HEADLINE_REGEX, headlineTitle);
|
||||
}
|
||||
} else if (item.title === "")
|
||||
item.title = currentNoteTitleFields?.title || "Untitled";
|
||||
}
|
||||
|
||||
if (isUpdating) {
|
||||
|
||||
Reference in New Issue
Block a user