add "(copy)" to implicitily titled documents

Normally, documents that are created get a title similar to this: "Sheet
- Mon, July 10, 2023". This commit adds " (copy)" to those documents
when copied.
This commit is contained in:
Ahmed Mazen 2023-07-10 18:01:45 +08:00
parent ce577e1a07
commit 4b3cd9484c

View file

@ -242,7 +242,8 @@ define([
title = "download";
}
if(title === "" && APP.startWithTemplate) {
var copyTitle = Messages._getKey('copy_title', [APP.startWithTemplate.content.metadata.title]);
var metadata = APP.startWithTemplate.content.metadata;
var copyTitle = Messages._getKey('copy_title', [metadata.title || metadata.defaultTitle]);
common.getMetadataMgr().updateTitle(copyTitle);
title = copyTitle;
}