Archived
Select first session on workspace change
This commit is contained in:
@@ -31,7 +31,7 @@ export class WorkspaceController {
|
|||||||
const sessions = await api.sessions(workspace.path);
|
const sessions = await api.sessions(workspace.path);
|
||||||
this.setState({ sessions });
|
this.setState({ sessions });
|
||||||
const sessionId = target?.sessionId;
|
const sessionId = target?.sessionId;
|
||||||
const session = sessionId ? sessions.find((s) => s.id === sessionId || s.id.startsWith(sessionId)) : undefined;
|
const session = sessionId ? sessions.find((s) => s.id === sessionId || s.id.startsWith(sessionId)) : sessions[0];
|
||||||
if (session) await this.sessions.selectSession(session, { updateUrl: target?.updateUrl });
|
if (session) await this.sessions.selectSession(session, { updateUrl: target?.updateUrl });
|
||||||
else if (target?.updateUrl !== false) this.updateUrl();
|
else if (target?.updateUrl !== false) this.updateUrl();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user