mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
browser add cookies.
This commit is contained in:
parent
5755b45888
commit
c9290bd88a
@ -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…
Reference in New Issue
Block a user