fix: linter issues

This commit is contained in:
K1ngfish3r
2026-04-23 01:04:42 +05:00
parent 5e195b7f53
commit 2396df38bb
111 changed files with 2738 additions and 2160 deletions
+15 -4
View File
@@ -15,7 +15,7 @@ import {
import { useAppStore } from '@/store';
import { usePluginCustomAssets } from '@/hooks/usePluginCustomAssets';
export default function ParseChapterSection() {
const ParseChapterSection = React.memo(function ParseChapterSection() {
const plugin = useAppStore(state => state.plugin);
const parseChapterPath = useAppStore(state => state.parseChapterPath);
const shouldAutoSubmitChapter = useAppStore(
@@ -30,6 +30,15 @@ export default function ParseChapterSection() {
const [fetchError, setFetchError] = useState('');
const [showRawHtml, setShowRawHtml] = useState(false);
const lastProcessedPath = useRef<string>();
const [prevPluginId, setPrevPluginId] = useState<string | undefined>();
if (plugin?.id !== prevPluginId) {
setPrevPluginId(plugin?.id);
setChapterPath('');
setChapterText('');
setFetchError('');
setShowRawHtml(false);
}
const { customCSSLoaded, customJSLoaded, customCSSError, customJSError } =
usePluginCustomAssets(plugin, chapterText);
@@ -56,7 +65,7 @@ export default function ParseChapterSection() {
await fetchChapterByPath(chapterPath);
};
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter' && chapterPath.trim()) {
fetchChapter();
}
@@ -128,7 +137,7 @@ export default function ParseChapterSection() {
placeholder="Enter chapter path..."
value={chapterPath}
onChange={e => setChapterPath(e.target.value)}
onKeyPress={handleKeyPress}
onKeyDown={handleKeyDown}
className="flex-1"
disabled={!plugin}
/>
@@ -327,4 +336,6 @@ export default function ParseChapterSection() {
</Card>
</div>
);
}
});
export default ParseChapterSection;