Satisfy the linter

This commit is contained in:
Oliver Jägle 2024-12-18 00:42:56 +01:00
parent 704aee4390
commit 985d4d3d5c
No known key found for this signature in database
GPG Key ID: 866E2BD1777473E9
2 changed files with 4 additions and 3 deletions

View File

@ -1 +1 @@
{ "commit": "6003c165ef9347d5a9f97ea711f84d37d65b5c0c" } { "commit": "704aee4390f420ce8032a1a0e2e76fb98b9ad566" }

View File

@ -3,10 +3,10 @@ import { useCallback, useEffect, useState } from 'react';
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';
import { import {
chatId as chatIdStore, chatId as chatIdStore,
description as descriptionStore,
db, db,
updateChatDescription, description as descriptionStore,
getMessages, getMessages,
updateChatDescription,
} from '~/lib/persistence'; } from '~/lib/persistence';
interface EditChatDescriptionOptions { interface EditChatDescriptionOptions {
@ -92,6 +92,7 @@ export function useEditChatDescription({
} }
const lengthValid = trimmedDesc.length > 0 && trimmedDesc.length <= 100; const lengthValid = trimmedDesc.length > 0 && trimmedDesc.length <= 100;
// Allow letters, numbers, spaces, and common punctuation but exclude characters that could cause issues // Allow letters, numbers, spaces, and common punctuation but exclude characters that could cause issues
const characterValid = /^[a-zA-Z0-9\s\-_.,!?()[\]{}'"]+$/.test(trimmedDesc); const characterValid = /^[a-zA-Z0-9\s\-_.,!?()[\]{}'"]+$/.test(trimmedDesc);