Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): add attachment check in handleHover and handleClick method also

Ramesh Mane476f6234b093
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/cells/Attachment.ts b/packages/nc-gui/components/smartsheet/grid/canvas/cells/Attachment.ts
index 829833c964..a57eca6689 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/cells/Attachment.ts
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/cells/Attachment.ts
@@ -297,7 +297,7 @@ export const AttachmentCellRenderer: CellRenderer = {
} catch {
attachments = []
}
- if (selected && attachments.length === 0) {
+ if (selected && (!ncIsArray(attachments) || !attachments.length)) {
/* const buttonWidth = 84
const buttonHeight = 24
const buttonX = x + (width - buttonWidth) / 2
@@ -448,7 +448,11 @@ export const AttachmentCellRenderer: CellRenderer = {
} catch {
attachments = []
}
- if (selected && attachments.length === 0) {
+ if (selected && (!ncIsArray(attachments) || !attachments.length)) {
+ if (!ncIsArray(attachments)) {
+ return true
+ }
+
const buttonWidth = 84
const buttonHeight = 24
const buttonX = x + (width - buttonWidth) / 2