Skip to content

Commit

Permalink
Fixing first install
Browse files Browse the repository at this point in the history
  • Loading branch information
daonb committed Aug 22, 2024
1 parent 4dd25b3 commit 9717846
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions aatp/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ export async function getTWRBuffer(page) {
}
return ret.trimEnd()
})
console.log("--> b4 trimming:", ret)
ret = ret.substring(checkedC)
console.log("TWR: ", ret)
checkedC = ret.length
console.log("TWR", ret)
return ret
}
export function webexecReset(uid: string) {
Expand Down
2 changes: 1 addition & 1 deletion aatp/ui/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ insecure=true`)
await page.keyboard.type("hide")
await page.keyboard.press("Enter")
})
test('connect to gate with no webexec', async () => {
test('connect to gate with no webexec, get install command', async () => {
await runSSHCommand(webexecSSHConfig, "webexec stop")
await connectFirstGate(page)
await sleep(1000)
Expand Down
12 changes: 1 addition & 11 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,17 +786,7 @@ export async function installCMD(shell: Shell, args: string[]) {
return
}

let uid = ""
try {
uid = await terminal7.pb.getUID()
} catch(e) {
terminal7.log("getUID returned an error", e)
}
if (!uid && native) {
shell.t.writeln("Error connecting to PeerBook")
shell.t.writeln("Please try again or `support`")
return
}
const uid = terminal7.pb.uid
let gate: Gate

if (args[0]) {
Expand Down
8 changes: 6 additions & 2 deletions src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,18 @@ export class Shell {
if (failure == Failure.TimedOut)
// hourglass emojy: 🍒
gate.notify("🍒 Connection timed out")
else
else if (failure == Failure.NotSupported) {
gate.notify("WebRTC agent unreachable")
} else
gate.notify(`Connect failed: ${failure || "Lost Connection"}`)

this.stopWatchdog()
console.log("onDisconnect", gate.firstConnection)
if (gate.firstConnection) {
this.onFirstConnectionDisconnect(gate)
return
}

this.stopWatchdog()
let res: string
try {
res = await this.runForm(this.reconnectForm, "menu")
Expand Down

0 comments on commit 9717846

Please sign in to comment.