Refactor CLI close logic and comment out debug log
Commented out the debug log in LineConnection's write method for cleaner output. Updated App.tsx to close CLI only for lines in the currently active station tab, improving accuracy when switching tabs.
This commit is contained in:
parent
68411ef611
commit
1ee447d2c7
|
|
@ -237,9 +237,9 @@ export default class LineConnection {
|
|||
return
|
||||
}
|
||||
|
||||
console.log(
|
||||
`Write command "${cmd}" to line ${this.config.lineNumber} of ${this.config.stationName}`
|
||||
)
|
||||
// console.log(
|
||||
// `Write command "${cmd.toString().replace(/\r/g, '\\r').replace(/\n/g, '\\n')}" to line ${this.config.lineNumber} of ${this.config.stationName}`
|
||||
// )
|
||||
|
||||
this.client.write(cmd)
|
||||
if (userName) {
|
||||
|
|
|
|||
|
|
@ -593,8 +593,9 @@ function App() {
|
|||
</Tabs.Panel>
|
||||
))}
|
||||
onChange={(id) => {
|
||||
if (selectedLines.length > 0) {
|
||||
selectedLines.forEach((el) => {
|
||||
const station = stations.find((el) => el.id === Number(activeTab));
|
||||
if (station) {
|
||||
(station?.lines || [])?.forEach((el) => {
|
||||
if (el?.userOpenCLI === user?.userName)
|
||||
socket?.emit("close_cli", {
|
||||
lineId: el?.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue