browser add cookies.

This commit is contained in:
Miroslav Šedivý 2020-12-23 02:41:15 +01:00
parent 5755b45888
commit c9290bd88a

View File

@ -297,6 +297,17 @@
this.tabHander = func
}
// TODO: Refactor.
public cookieEvent(event: string, payload?: any | undefined) {
this.websocket.send('cookies/' + event, { payload })
}
// TODO: Refactor.
cookieHander?: (event: string, payload: any) => any
public cookieSubscribe(func: (event: string, payload: any) => any) {
this.cookieHander = func
}
/////////////////////////////
// Component lifecycle
/////////////////////////////
@ -328,6 +339,11 @@
if (event.match(/^tabs\//) && this.tabHander) {
this.tabHander(event, payload.payload)
}
// TODO: Refactor.
if (event.match(/^cookies\//) && this.cookieHander) {
this.cookieHander(event, payload.payload)
}
})
this.websocket.on('connecting', () => {
Vue.set(this.state.connection, 'websocket', 'connecting')