Replace browser popups with in-page dialogs; focus new-task prompt
This commit is contained in:
Vendored
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { post } from "./api.js";
|
||||
import { errorText, h, replace } from "./dom.js";
|
||||
import { errorText, h, replace, showAlert } from "./dom.js";
|
||||
import { openTranscript } from "./panes.js";
|
||||
import { activeTasks, currentSession, findTask, onEach, state } from "./state.js";
|
||||
export function mountNavbar(root, show) {
|
||||
@@ -28,7 +28,7 @@ export function mountNavbar(root, show) {
|
||||
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, admin, connLabel, conn, me);
|
||||
render();
|
||||
addEventListener("keydown", (e) => {
|
||||
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
||||
if (e.key === "k" && (e.metaKey || e.ctrlKey) && !document.querySelector("dialog[open]")) {
|
||||
e.preventDefault();
|
||||
openSwitcher();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function openSwitcher() {
|
||||
go(task.id);
|
||||
}
|
||||
catch (err) {
|
||||
alert(errorText(err));
|
||||
void showAlert(errorText(err));
|
||||
}
|
||||
};
|
||||
const render = () => {
|
||||
|
||||
Reference in New Issue
Block a user