Merge pull request #522 from kaalibro/dev
🐛 fix: CivitAI Helper and PromptEditor CivitAI Helper buttons (#520) PromptEditor: revert topull/532/head8409d3cas #198 reappeared on2a651f6PromptEditor: add svg icons for buttons
commit
06ae6ca000
File diff suppressed because one or more lines are too long
|
|
@ -79,11 +79,10 @@ const TagList = memo<TagListProps>(({ tags, setTags, type, setValue }) => {
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!addAutocompleteToArea || bind) return;
|
||||
let retryTimes = 0;
|
||||
let bindInterval: any;
|
||||
try {
|
||||
bindInterval = setInterval(() => {
|
||||
if (!addAutocompleteToArea || bind) return;
|
||||
let retryTimes = 0;
|
||||
const bindInterval = setInterval(() => {
|
||||
if (bind || retryTimes > 10) {
|
||||
const inputDom = document.querySelector(`#${id}`) as HTMLInputElement;
|
||||
if (inputDom) {
|
||||
|
|
@ -98,9 +97,6 @@ const TagList = memo<TagListProps>(({ tags, setTags, type, setValue }) => {
|
|||
} catch (error) {
|
||||
consola.error('🤯 [promptTagEditor]', error);
|
||||
}
|
||||
return () => {
|
||||
if (bindInterval) clearInterval(bindInterval);
|
||||
};
|
||||
}, [bind]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import isEqual from 'fast-deep-equal';
|
||||
import { memo } from 'react';
|
||||
import { memo, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import PromptPicker from '@/components/PromptEditor/PromptPicker';
|
||||
import replaceIcon from '@/scripts/replaceIcon';
|
||||
import { selectors, useAppStore } from '@/store';
|
||||
|
||||
import Prompt from './Prompt';
|
||||
|
|
@ -11,6 +12,11 @@ import Prompt from './Prompt';
|
|||
const PromptEditor = memo(() => {
|
||||
const setting = useAppStore(selectors.currentSetting, isEqual);
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
if (setting.svgIcon) replaceIcon();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Flexbox gap={16}>
|
||||
{setting.promptEditor && (
|
||||
|
|
|
|||
|
|
@ -279,5 +279,5 @@ export default () => {
|
|||
}, 500);
|
||||
};
|
||||
|
||||
return helperFix;
|
||||
return helperFix();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue