Skip to content

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

chore: lint

Pranav Cf8f3c35d7d4b
diff --git a/packages/nc-gui/composables/useViewSorts.ts b/packages/nc-gui/composables/useViewSorts.ts
index 1fda5fb2e5..6ecf2843fe 100644
--- a/packages/nc-gui/composables/useViewSorts.ts
+++ b/packages/nc-gui/composables/useViewSorts.ts
@@ -146,8 +146,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
const existingSortIndex = sorts.value.findIndex((s) => s.fk_column_id === column.id)
const existingSort = existingSortIndex > -1 ? sorts.value[existingSortIndex] : undefined
- const isLocalMode = isPublic.value || isSharedBase.value || isLocked.value
-
+ const isLocalMode = isPublic.value || isSharedBase.value || !isUIAllowed('sortSync')
// Delete existing sort and not update the state as sort count in UI will change for a sec
if (existingSort && !isLocalMode) {
await $api.internal.postOperation(
@@ -240,8 +239,8 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
async function deleteSort(sort: SortType, i: number, undo = false) {
try {
- const isLocalMode = isPublic.value || isSharedBase.value || isLocked.value
- if (isUIAllowed('sortSync') && sort.id && !isLocalMode) {
+ const isLocalMode = isPublic.value || isSharedBase.value || !isUIAllowed('sortSync')
+ if (sort.id && !isLocalMode) {
await $api.internal.postOperation(
meta.value!.fk_workspace_id!,
meta.value!.base_id!,
diff --git a/packages/nocodb/src/services/v3/data-attachment-v3.service.ts b/packages/nocodb/src/services/v3/data-attachment-v3.service.ts
index a22d6e8801..87ddaf04e8 100644
--- a/packages/nocodb/src/services/v3/data-attachment-v3.service.ts
+++ b/packages/nocodb/src/services/v3/data-attachment-v3.service.ts
@@ -105,7 +105,12 @@ export class DataAttachmentV3Service {
signedUrl: undefined,
};
processedAttachments.push(processedAttachment);
- if (supportsThumbnails({ mimetype: downloadedAttachment.mimeType })) {
+ if (
+ supportsThumbnails({
+ mimetype: downloadedAttachment.mimeType,
+ size: downloadedAttachment.fileSize,
+ })
+ ) {
generateThumbnailAttachments.push(processedAttachment);
}
}
diff --git a/packages/nocodb/src/utils/attachmentUtils.ts b/packages/nocodb/src/utils/attachmentUtils.ts
index 9f5f4e93cb..039b7293a3 100644
--- a/packages/nocodb/src/utils/attachmentUtils.ts
+++ b/packages/nocodb/src/utils/attachmentUtils.ts
@@ -1,4 +1,6 @@
+import { ncIsNumber } from 'nocodb-sdk';
import { imageMimeTypes } from '~/helpers/attachmentHelpers';
+import { getThumbnailMaxSize } from '~/utils/nc-config/constants';
export const isOfficeDocument = (..._args) => {
return false;