mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
feat: Add optimistic UI for video comments
- Implement optimistic updates for comment creation, deletion, resolution, tag, and content changes - Enhance user experience by providing immediate feedback for comment actions - Integrate `sonner` toasts for success and error notifications - Improve video data fetching error handling and logging - Refine active video version selection logic for robustness - Simplify video detail not-found page, removing dynamic project link
This commit is contained in:
@@ -67,10 +67,11 @@ export default function NewProjectPage() {
|
||||
const res = await fetch('/api/workspaces');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
setWorkspaces(data.workspaces);
|
||||
const workspacesData = data.workspaces || [];
|
||||
setWorkspaces(workspacesData);
|
||||
// Auto-select if only one workspace and none preselected
|
||||
if (!preselectedWorkspace && data.workspaces.length === 1) {
|
||||
setFormData(prev => ({ ...prev, workspaceId: data.workspaces[0].id }));
|
||||
if (!preselectedWorkspace && workspacesData.length === 1) {
|
||||
setFormData(prev => ({ ...prev, workspaceId: workspacesData[0].id }));
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user