From 985d4d3d5cd2a5a1007f5782a33642c3d2bd5572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 18 Dec 2024 00:42:56 +0100 Subject: [PATCH] Satisfy the linter --- app/commit.json | 2 +- app/lib/hooks/useEditChatDescription.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/commit.json b/app/commit.json index a8afa65..aa44738 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "6003c165ef9347d5a9f97ea711f84d37d65b5c0c" } +{ "commit": "704aee4390f420ce8032a1a0e2e76fb98b9ad566" } diff --git a/app/lib/hooks/useEditChatDescription.ts b/app/lib/hooks/useEditChatDescription.ts index 5230d6c..bb1e8dc 100644 --- a/app/lib/hooks/useEditChatDescription.ts +++ b/app/lib/hooks/useEditChatDescription.ts @@ -3,10 +3,10 @@ import { useCallback, useEffect, useState } from 'react'; import { toast } from 'react-toastify'; import { chatId as chatIdStore, - description as descriptionStore, db, - updateChatDescription, + description as descriptionStore, getMessages, + updateChatDescription, } from '~/lib/persistence'; interface EditChatDescriptionOptions { @@ -92,6 +92,7 @@ export function useEditChatDescription({ } const lengthValid = trimmedDesc.length > 0 && trimmedDesc.length <= 100; + // Allow letters, numbers, spaces, and common punctuation but exclude characters that could cause issues const characterValid = /^[a-zA-Z0-9\s\-_.,!?()[\]{}'"]+$/.test(trimmedDesc);