mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-09 07:12:39 +02:00
remove url from share and add auth (#260)
This commit is contained in:
parent
a7abdc43a5
commit
041ab25b7b
3 changed files with 20 additions and 25 deletions
|
|
@ -301,13 +301,12 @@ export function BuildAssistantSection() {
|
|||
const urlPrompt = searchParams.get('prompt');
|
||||
const urlTemplate = searchParams.get('template');
|
||||
const sharedId = searchParams.get('shared');
|
||||
const importUrl = searchParams.get('importUrl');
|
||||
|
||||
const run = async () => {
|
||||
if (sharedId || importUrl) {
|
||||
if (sharedId) {
|
||||
try {
|
||||
setAutoCreateLoading(true);
|
||||
const workflowObj = await loadSharedWorkflow(sharedId || importUrl!);
|
||||
const workflowObj = await loadSharedWorkflow(sharedId);
|
||||
await createProjectFromJsonWithOptions({
|
||||
workflowJson: JSON.stringify(workflowObj),
|
||||
router,
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ export function CreateProject({ defaultName, onOpenProjectPane, isProjectPaneOpe
|
|||
const urlPrompt = searchParams.get('prompt');
|
||||
const urlTemplate = searchParams.get('template');
|
||||
const sharedId = searchParams.get('shared');
|
||||
const importUrl = searchParams.get('importUrl');
|
||||
|
||||
// Add this effect to update name when defaultName changes
|
||||
useEffect(() => {
|
||||
|
|
@ -168,13 +167,13 @@ export function CreateProject({ defaultName, onOpenProjectPane, isProjectPaneOpe
|
|||
// Add effect to handle URL parameters for auto-creation
|
||||
useEffect(() => {
|
||||
const handleAutoCreate = async () => {
|
||||
// Auto-create from template/prompt, or import from shared/id/url
|
||||
if ((urlPrompt || urlTemplate || sharedId || importUrl) && !importLoading && !autoCreateLoading) {
|
||||
// Auto-create from template/prompt, or import from shared id
|
||||
if ((urlPrompt || urlTemplate || sharedId) && !importLoading && !autoCreateLoading) {
|
||||
setAutoCreateLoading(true);
|
||||
try {
|
||||
if (sharedId || importUrl) {
|
||||
// Load workflow via server action (supports id or URL)
|
||||
const workflowObj = await loadSharedWorkflow(sharedId || importUrl!);
|
||||
if (sharedId) {
|
||||
// Load workflow via server action (by id)
|
||||
const workflowObj = await loadSharedWorkflow(sharedId);
|
||||
await createProjectFromJsonWithOptions({
|
||||
workflowJson: JSON.stringify(workflowObj),
|
||||
router,
|
||||
|
|
@ -203,7 +202,7 @@ export function CreateProject({ defaultName, onOpenProjectPane, isProjectPaneOpe
|
|||
};
|
||||
|
||||
handleAutoCreate();
|
||||
}, [urlPrompt, urlTemplate, sharedId, importUrl, importLoading, autoCreateLoading, router]);
|
||||
}, [urlPrompt, urlTemplate, sharedId, importLoading, autoCreateLoading, router]);
|
||||
|
||||
// Inject glow animation styles
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue