fix: 'Untitled' is not translated

closes #5949
This commit is contained in:
Tom Moor
2023-10-05 19:44:54 -04:00
parent 1359f44814
commit 5e0b812083

View File

@@ -1,5 +1,5 @@
import { addDays, differenceInDays } from "date-fns";
import { t } from "i18next";
import i18n, { t } from "i18next";
import floor from "lodash/floor";
import { action, autorun, computed, observable, set } from "mobx";
import { ExportContentType } from "@shared/types";
@@ -241,11 +241,6 @@ export default class Document extends ParanoidModel {
return this.title === "";
}
@computed
get titleWithDefault(): string {
return this.title || "Untitled";
}
@computed
get permanentlyDeletedAt(): string | undefined {
if (!this.deletedAt) {
@@ -279,6 +274,10 @@ export default class Document extends ParanoidModel {
return floor((this.tasks.completed / this.tasks.total) * 100);
}
get titleWithDefault(): string {
return this.title || i18n.t("Untitled");
}
@action
updateTasks(total: number, completed: number) {
if (total !== this.tasks.total || completed !== this.tasks.completed) {