mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
refactor: update socket types
This commit is contained in:
1 parent
bb2a1a145f
commit
ebd713200c
6 files changed
+120
-19
No files matched your search
@@ -18,6 +18,7 @@ function newSession() {
|
||||
discovered: false,
|
||||
})
|
||||
return {
|
||||
_id: '',
|
||||
status: 'inactive',
|
||||
graph,
|
||||
pwd: '',
|
||||
@@ -100,18 +101,10 @@ function updateGraph(event: { discover: FileObject[]; pwd: string }) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateHints(hints: never) {
|
||||
store.session.hints.push(hints)
|
||||
}
|
||||
|
||||
function updateStatus(status: string) {
|
||||
store.session.status = status
|
||||
}
|
||||
|
||||
function setTasks(tasks: never[]) {
|
||||
store.session.tasks = tasks
|
||||
}
|
||||
|
||||
export function useTerminal() {
|
||||
return term
|
||||
}
|
||||
@@ -150,12 +143,6 @@ function setup() {
|
||||
socket.on('graph', (event: { discover: FileObject[]; pwd: string }) => {
|
||||
updateGraph(event)
|
||||
})
|
||||
socket.on('hints', (event: never) => {
|
||||
updateHints(event)
|
||||
})
|
||||
socket.on('tasks', (tasks: never[]) => {
|
||||
setTasks(tasks)
|
||||
})
|
||||
socket.on('status', (event: string) => {
|
||||
updateStatus(event)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user