cleanup
This commit is contained in:
@@ -32,7 +32,7 @@ const resolveCorrespondents = (doc) => {
|
||||
const results = [];
|
||||
|
||||
doc.correspondents.forEach((entry, index) => {
|
||||
if (!entry) return;
|
||||
if (!entry || typeof entry.name !== 'string') return;
|
||||
|
||||
const id = entry.id;
|
||||
const name = entry.name.trim();
|
||||
@@ -68,16 +68,8 @@ const resolveDocumentType = (doc) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (typeof type === 'string') {
|
||||
const name = type.trim();
|
||||
if (!name) {
|
||||
return null;
|
||||
}
|
||||
return { id: fallbackId, name };
|
||||
}
|
||||
|
||||
if (typeof type === 'object') {
|
||||
const name = (type.name || type.label || '').trim();
|
||||
if (typeof type === 'object' && typeof type.name === 'string') {
|
||||
const name = type.name.trim();
|
||||
if (!name) {
|
||||
return null;
|
||||
}
|
||||
@@ -138,7 +130,7 @@ const DocumentThumbnailImage = ({
|
||||
document,
|
||||
ensureAssetUrl,
|
||||
getDocumentAsset,
|
||||
alt,
|
||||
alt = '',
|
||||
maxSize = LIST_ICON_SIZE,
|
||||
scrollRootRef = null,
|
||||
}) => {
|
||||
@@ -210,7 +202,7 @@ const DocumentThumbnailImage = ({
|
||||
{url ? (
|
||||
<img
|
||||
src={url}
|
||||
alt={alt || ''}
|
||||
alt={alt}
|
||||
className="document-thumbnail"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
@@ -883,7 +875,7 @@ const DocumentsTable = ({
|
||||
aria-label={`Rename folder ${folder.name}`}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
const nextName = window.prompt('Rename folder', folder.name || '');
|
||||
const nextName = window.prompt('Rename folder', folder.name);
|
||||
if (!nextName) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user