Skip to content

Commit 06f9821

Browse files
committed
🐛(frontend) do not compare drive and attachment mime type
Currently to know if an attachment already exists in configured Drive instance, we compare file retrieved by name, size and mime type but sometimes the mime type cannot match. As it appears that name and size are enough to compare resources we remove the mime type check.
1 parent 6f16b88 commit 06f9821

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/frontend/src/features/layouts/components/main/header/authenticated.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useImportTaskStatus } from "@/hooks/use-import-task";
1313
import { StatusEnum } from "@/features/api/gen";
1414
import { CircularProgress } from "@/features/ui/components/circular-progress";
1515
import { TaskImportCacheHelper } from "@/features/utils/task-import-cache";
16+
import { useTheme } from "@/features/providers/theme";
1617

1718

1819
type AuthenticatedHeaderProps = HeaderProps & {
@@ -58,6 +59,7 @@ export const AuthenticatedHeader = ({
5859
export const HeaderRight = () => {
5960
const { user } = useAuth();
6061
const { isDesktop } = useResponsive();
62+
const { themeConfig } = useTheme();
6163

6264
return (
6365
<>
@@ -70,7 +72,7 @@ export const HeaderRight = () => {
7072
email: user.email || ""
7173
} : null}
7274
logout={logout}
73-
termOfServiceUrl={process.env.NEXT_PUBLIC_TERMS_OF_SERVICE_URL}
75+
termOfServiceUrl={themeConfig.terms_of_service_url}
7476
actions={
7577
<div className="user-menu__footer-action">
7678
<LanguagePicker size="small" compact />

src/frontend/src/features/layouts/components/thread-view/components/thread-attachment-list/drive-upload-button.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export const DriveUploadButton = ({ attachment }: DriveUploadButtonProps) => {
108108
if (!driveFileId && driveFiles.length > 0) {
109109
const file = driveFiles.find((file) =>
110110
file.filename === attachment.name
111-
&& file.mimetype === attachment.type
112111
&& file.size === attachment.size
113112
);
114113
if (file) {

0 commit comments

Comments
 (0)