changed getTitleWithoutExst method to now return exsts if title is empty

This commit is contained in:
Mushka Nikita 2023-02-21 13:23:59 +03:00
parent b51bfb2450
commit 90c40d83a1

View File

@ -40,8 +40,9 @@ export const getAccessIcon = (access) => {
};
export const getTitleWithoutExst = (item, fromTemplate) => {
return item.fileExst && !fromTemplate
? item.title.split(".").slice(0, -1).join(".")
const titleWithoutExst = item.title.split(".").slice(0, -1).join(".");
return titleWithoutExst && item.fileExst && !fromTemplate
? titleWithoutExst
: item.title;
};