Upload folder using huggingface_hub
Browse files
client/src/components/Refinity.tsx
CHANGED
|
@@ -57,13 +57,29 @@ const mockTasks: Task[] = [
|
|
| 57 |
];
|
| 58 |
|
| 59 |
const Refinity: React.FC = () => {
|
| 60 |
-
const [stage, setStage] = React.useState<Stage>(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
const [tasks, setTasks] = React.useState<Task[]>([]);
|
| 62 |
const [selectedTaskId, setSelectedTaskId] = React.useState<string>('');
|
| 63 |
const [versions, setVersions] = React.useState<Version[]>([]);
|
| 64 |
const [currentVersionId, setCurrentVersionId] = React.useState<string | null>(null);
|
| 65 |
const [previewVersionId, setPreviewVersionId] = React.useState<string | null>(null);
|
| 66 |
-
const [isFullscreen, setIsFullscreen] = React.useState<boolean>(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
const [compareUIOpen, setCompareUIOpen] = React.useState<boolean>(false);
|
| 68 |
const [compareA, setCompareA] = React.useState<string>('');
|
| 69 |
const [compareB, setCompareB] = React.useState<string>('');
|
|
|
|
| 57 |
];
|
| 58 |
|
| 59 |
const Refinity: React.FC = () => {
|
| 60 |
+
const [stage, setStage] = React.useState<Stage>(() => {
|
| 61 |
+
try {
|
| 62 |
+
const h = String(window.location.hash || '');
|
| 63 |
+
const q = h.includes('?') ? h.slice(h.indexOf('?') + 1) : '';
|
| 64 |
+
const params = new URLSearchParams(q);
|
| 65 |
+
const s = String(params.get('stage') || '');
|
| 66 |
+
if (s === 'flow' || s === 'preview' || s === 'editor' || s === 'task') return s as any;
|
| 67 |
+
} catch {}
|
| 68 |
+
return 'task';
|
| 69 |
+
});
|
| 70 |
const [tasks, setTasks] = React.useState<Task[]>([]);
|
| 71 |
const [selectedTaskId, setSelectedTaskId] = React.useState<string>('');
|
| 72 |
const [versions, setVersions] = React.useState<Version[]>([]);
|
| 73 |
const [currentVersionId, setCurrentVersionId] = React.useState<string | null>(null);
|
| 74 |
const [previewVersionId, setPreviewVersionId] = React.useState<string | null>(null);
|
| 75 |
+
const [isFullscreen, setIsFullscreen] = React.useState<boolean>(() => {
|
| 76 |
+
try {
|
| 77 |
+
const h = String(window.location.hash || '');
|
| 78 |
+
const q = h.includes('?') ? h.slice(h.indexOf('?') + 1) : '';
|
| 79 |
+
const params = new URLSearchParams(q);
|
| 80 |
+
return params.get('fullscreen') === '1';
|
| 81 |
+
} catch { return false; }
|
| 82 |
+
});
|
| 83 |
const [compareUIOpen, setCompareUIOpen] = React.useState<boolean>(false);
|
| 84 |
const [compareA, setCompareA] = React.useState<string>('');
|
| 85 |
const [compareB, setCompareB] = React.useState<string>('');
|