in frontend/src/js/components/UtilComponents/documentTitle.js [1:28]
export function calculateResourceTitle(resource) {
const postfix = "Giant";
if(resource) {
if(resource.type === 'email' && resource.subject) {
return `${resource.subject} - ${postfix}`;
}
const parts = (resource.display || decodeURIComponent(resource.uri)).split("/");
const isResource = parts.length > 1;
const isBlob = !isResource && resource.parents.length > 0;
if(isResource) {
return `${parts[parts.length - 1]} - ${postfix}`;
} else if(isBlob) {
// Render parent resource name if viewing a blob.
// For user-uploaded files this will be the filename they uploaded with.
const parts = resource.parents[0].uri.split("/");
if(parts.length > 1) {
return `${decodeURIComponent(parts[parts.length - 1])} - ${postfix}`;
}
}
}
return postfix;
}