fix: proper boundary on the project in the data

This commit is contained in:
2026-02-11 10:48:05 +01:00
parent 48f7fc16e5
commit 513ade1624
7 changed files with 133 additions and 103 deletions

View File

@@ -128,19 +128,19 @@ const PostEditor: React.FC<PostEditorProps> = ({ post }) => {
window.electronAPI?.posts.hasPublishedVersion(post.id).then(setHasPublishedVersion);
}, [post.id]);
// Load available categories from localStorage
// Load available categories from backend (project-scoped)
useEffect(() => {
const savedCategories = localStorage.getItem('bds-categories');
if (savedCategories) {
const loadCategories = async () => {
try {
const parsed = JSON.parse(savedCategories);
if (Array.isArray(parsed) && parsed.length > 0) {
setAvailableCategories(parsed);
const categories = await window.electronAPI?.meta.getCategories();
if (categories && categories.length > 0) {
setAvailableCategories(categories);
}
} catch {
// Keep defaults
}
}
};
loadCategories();
}, []);
// Resolve media URLs in content for display