mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Remove creator field from empty templates
This commit is contained in:
parent
058df1ed5c
commit
9309b06a2e
@ -352,12 +352,23 @@ define([
|
||||
cpIndex: 0
|
||||
};
|
||||
|
||||
const fixProps = (title) => {
|
||||
try {
|
||||
const props = getEditor().asc_getCoreProps();
|
||||
if (!props) { return; }
|
||||
props.title = title;
|
||||
if (!content.hashes || !content.hashes.length) {
|
||||
// No CP: document is using our templates
|
||||
// --> fix the "creator" field
|
||||
props.creator = "";
|
||||
}
|
||||
getEditor().asc_setCoreProps(props);
|
||||
} catch () {}
|
||||
};
|
||||
var getContent = function (title) {
|
||||
try {
|
||||
getEditor().asc_setCoreProps({
|
||||
...getEditor().asc_getCoreProps(),
|
||||
'title': title,
|
||||
});
|
||||
// Update document metadata with latest title
|
||||
fixProps(title);
|
||||
return getEditor().asc_nativeGetFile();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user