mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-30 06:50:55 +02:00
browser add cookies.
This commit is contained in:
parent
5755b45888
commit
c9290bd88a
1 changed files with 16 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue