Replace browser popups with in-page dialogs; focus new-task prompt
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { post, type Project } from "./api.js";
|
||||
import { errorText, h, replace } from "./dom.js";
|
||||
import { errorText, h, replace, showAlert } from "./dom.js";
|
||||
import { openTranscript } from "./panes.js";
|
||||
import { currentSession, onEach, state } from "./state.js";
|
||||
|
||||
@@ -51,7 +51,7 @@ function newTaskForm(projectId: string): HTMLElement {
|
||||
const task = await post("/api/projects/{projectId}/tasks", { path: { projectId }, body: { title: title.value } });
|
||||
location.hash = `#/task/${task.id}`;
|
||||
} catch (err) {
|
||||
alert(errorText(err));
|
||||
void showAlert(errorText(err));
|
||||
}
|
||||
};
|
||||
return form;
|
||||
@@ -67,7 +67,7 @@ function newProjectForm(): HTMLElement {
|
||||
await post("/api/projects", { body: { name: name.value, repo_path: path.value } });
|
||||
form.reset();
|
||||
} catch (err) {
|
||||
alert(errorText(err));
|
||||
void showAlert(errorText(err));
|
||||
}
|
||||
};
|
||||
return h("details", { class: "add-project", open: state.projects.length === 0 }, h("summary", {}, "Add project"), form);
|
||||
|
||||
Reference in New Issue
Block a user