Compare commits
No commits in common. "bc62e1a0ad736788959a27cd7011eeded7e072aa" and "907d8b53933e4cbb9840736c4c632720123de964" have entirely different histories.
bc62e1a0ad
...
907d8b5393
|
|
@ -1,5 +1,5 @@
|
|||
////
|
||||
// version: 66c75ff
|
||||
// version: d95d2ec
|
||||
|
||||
// src/js/dom.ts
|
||||
var content2 = $("content");
|
||||
|
|
@ -168,37 +168,6 @@ function handleOutput(msg) {
|
|||
|
||||
// src/js/session.ts
|
||||
var sessionId = randomId();
|
||||
var projectName = $("project-name");
|
||||
var projectCwd = $("project-cwd");
|
||||
var sessionStore = new Map;
|
||||
function handleSessionStart(msg) {
|
||||
sessionStore.set("NOSE_DIR", msg.data.NOSE_DIR);
|
||||
updateProjectName(msg.data.project);
|
||||
updateCwd(msg.data.cwd);
|
||||
browserCommands.mode?.(msg.data.mode);
|
||||
}
|
||||
function handleSessionUpdate(msg) {
|
||||
const data = msg.data;
|
||||
if (data.project)
|
||||
updateProjectName(data.project);
|
||||
if (data.cwd)
|
||||
updateCwd(data.cwd);
|
||||
}
|
||||
function updateProjectName(project) {
|
||||
sessionStore.set("project", project);
|
||||
projectName.textContent = project;
|
||||
updateCwd("/");
|
||||
}
|
||||
function updateCwd(cwd) {
|
||||
cwd = displayProjectPath(cwd);
|
||||
sessionStore.set("cwd", cwd);
|
||||
projectCwd.textContent = cwd;
|
||||
}
|
||||
function displayProjectPath(path) {
|
||||
let prefix = sessionStore.get("NOSE_DIR") || "";
|
||||
prefix += "/" + sessionStore.get("project");
|
||||
return path.replace(prefix, "") || "/";
|
||||
}
|
||||
|
||||
// src/js/stream.ts
|
||||
function handleStreamStart(msg) {
|
||||
|
|
@ -565,11 +534,8 @@ async function dispatchMessage(msg) {
|
|||
case "game:start":
|
||||
await handleGameStart(msg);
|
||||
break;
|
||||
case "session:start":
|
||||
handleSessionStart(msg);
|
||||
break;
|
||||
case "session:update":
|
||||
handleSessionUpdate(msg);
|
||||
case "ui:mode":
|
||||
browserCommands.mode?.(msg.data);
|
||||
break;
|
||||
default:
|
||||
console.error("unknown message type", msg);
|
||||
|
|
@ -651,6 +617,7 @@ function cacheCommands(cmds) {
|
|||
commands.push(...cmds);
|
||||
commands.push(...Object.keys(browserCommands));
|
||||
commands.sort();
|
||||
console.log("CMDS", commands);
|
||||
}
|
||||
|
||||
// src/js/completion.ts
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ export function handleSessionUpdate(msg: SessionUpdateMessage) {
|
|||
function updateProjectName(project: string) {
|
||||
sessionStore.set("project", project)
|
||||
projectName.textContent = project
|
||||
updateCwd("/")
|
||||
}
|
||||
|
||||
function updateCwd(cwd: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user