diff options
author | bobzel <zzzman@gmail.com> | 2025-03-10 16:23:45 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-03-10 16:23:45 -0400 |
commit | 7e5ba63c3eb8bf36b3bbb81f46248766a7342d60 (patch) | |
tree | d3191da49f81b008f97dead32b3a6459f37539d1 /src/client/views/StyleProviderQuiz.tsx | |
parent | 88134739073691e0094151722961f85204ccb1af (diff) |
fixed compile errors
Diffstat (limited to 'src/client/views/StyleProviderQuiz.tsx')
-rw-r--r-- | src/client/views/StyleProviderQuiz.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/StyleProviderQuiz.tsx b/src/client/views/StyleProviderQuiz.tsx index bcb4b4ec1..0268771ff 100644 --- a/src/client/views/StyleProviderQuiz.tsx +++ b/src/client/views/StyleProviderQuiz.tsx @@ -1,6 +1,5 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Tooltip } from '@mui/material'; -import axios from 'axios'; import * as React from 'react'; import { returnFalse, setupMoveUpEvents } from '../../ClientUtils'; import { emptyFunction } from '../../Utils'; @@ -86,7 +85,7 @@ export namespace styleProviderQuiz { if (!quizBoxes.length) { imgBox.Loading = true; - const response = await Networking.PostToServer('/labels', { file: i ? i : imgBox.paths[0], drag: i ? 'drag' : 'full', smart: quiz }); + const response = (await Networking.PostToServer('/labels', { file: i ? i : imgBox.paths[0], drag: i ? 'drag' : 'full', smart: quiz })) as { result: string }; const parsedResponse = JSON.parse(response.result.replace(/'/g, '"')); if (parsedResponse['boxes'].length != 0) { createBoxes(imgBox, parsedResponse['boxes'], parsedResponse['text']); @@ -222,8 +221,8 @@ export namespace styleProviderQuiz { */ function extractHexAndSentences(inputString: string) { // Regular expression to match a hexadecimal number at the beginning followed by a period and sentences - const regex = /^#([0-9A-Fa-f]+)\.\s*(.+)$/s; - const match = inputString.match(regex); + const regex = /^#([0-9A-Fa-f]+)\.\s*(.+)$/; + const match = inputString.replace('\n', ' ').match(regex); if (match) { const hexNumber = match[1]; |