fix(assets): Review PR #26 – Upload unter Brew-Lock, inject per Ref, metadataEditor zurückgenommen
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Successful in 2m14s
CI / Storage (mongo) (pull_request) Successful in 1m42s
CI / Storage (postgres) (pull_request) Successful in 1m53s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dev-bot BotandClaude Sonnet 5.5 committed 2026-11-26 01:24:26 +00:00
1 parent c57bef85c9
commit 1ff86709b8
4 files changed
+39 -23

No files matched your search

+4 -2
View File
@@ -11,6 +11,8 @@ export const useAssetUpload = ({ editId, containerRef, inject, active = true })=
const [linked, setLinked] = useState(false);
const [state, setState] = useState({ busy: false, percent: null, name: '', errors: [], done: 0 });
const busyRef = useRef(false);
const injectRef = useRef(inject);
injectRef.current = inject;
useEffect(()=>{
let live = true;
@@ -36,10 +38,10 @@ export const useAssetUpload = ({ editId, containerRef, inject, active = true })=
const { markdown, errors } = await uploadFiles(editId, files, cfg, {
onProgress : ({ percent, name })=>setState((s)=>({ ...s, percent, name }))
});
if(markdown.length) inject(`${markdown.join('\n')}\n`);
if(markdown.length) injectRef.current(`${markdown.join('\n')}\n`);
busyRef.current = false;
setState({ busy: false, percent: null, name: '', errors, done: markdown.length });
}, [available, editId, cfg, inject]);
}, [available, editId, cfg]);
// Drag-and-drop und Einfügen im Text-Editor (Capture-Phase, vor CodeMirror). Nur Bilddateien, Text bleibt unberührt.
useEffect(()=>{