refac
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import {
|
||||
chatId as activeChatId,
|
||||
settings,
|
||||
showControls,
|
||||
showSettings,
|
||||
terminalServers,
|
||||
selectedTerminalId,
|
||||
@@ -63,6 +64,9 @@
|
||||
const selectDirect = async (terminal: (typeof directTerminals)[0]) => {
|
||||
const newId = $selectedTerminalId === terminal.url ? null : terminal.url;
|
||||
selectedTerminalId.set(newId);
|
||||
if (newId && window.matchMedia('(min-width: 1024px)').matches) {
|
||||
showControls.set($settings?.showFilesOnTerminalSelect ?? true);
|
||||
}
|
||||
|
||||
// Enable the selected direct terminal, disable all others
|
||||
const updatedServers = ($settings?.terminalServers ?? []).map((s) => ({
|
||||
@@ -82,7 +86,11 @@
|
||||
};
|
||||
|
||||
const selectSystem = async (terminal: (typeof systemTerminals)[0]) => {
|
||||
selectedTerminalId.set($selectedTerminalId === terminal.id ? null : terminal.id);
|
||||
const newId = $selectedTerminalId === terminal.id ? null : terminal.id;
|
||||
selectedTerminalId.set(newId);
|
||||
if (newId && window.matchMedia('(min-width: 1024px)').matches) {
|
||||
showControls.set($settings?.showFilesOnTerminalSelect ?? true);
|
||||
}
|
||||
|
||||
// Disable all direct terminals when switching to a system terminal
|
||||
if ($settings?.terminalServers?.some((s) => s.enabled)) {
|
||||
|
||||
Reference in New Issue
Block a user