commit
0a6f156537
|
@ -69,7 +69,7 @@ func handleReader(q chan Event, r io.Reader) error {
|
||||||
q <- &NotificationEvent{¬ification}
|
q <- &NotificationEvent{¬ification}
|
||||||
}
|
}
|
||||||
case "delete":
|
case "delete":
|
||||||
q <- &DeleteEvent{ID(strings.TrimSpace(token[1]))}
|
q <- &DeleteEvent{ID: ID(strings.TrimSpace(token[1]))}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
q <- &ErrorEvent{err}
|
q <- &ErrorEvent{err}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
@ -128,7 +129,11 @@ func (c *WSClient) handleWS(ctx context.Context, rawurl string, q chan Event) er
|
||||||
q <- &NotificationEvent{Notification: ¬ification}
|
q <- &NotificationEvent{Notification: ¬ification}
|
||||||
}
|
}
|
||||||
case "delete":
|
case "delete":
|
||||||
q <- &DeleteEvent{ID: ID(fmt.Sprint(int64(s.Payload.(float64))))}
|
if f, ok := s.Payload.(float64); ok {
|
||||||
|
q <- &DeleteEvent{ID: ID(fmt.Sprint(int64(f)))}
|
||||||
|
} else {
|
||||||
|
q <- &DeleteEvent{ID: ID(strings.TrimSpace(s.Payload.(string)))}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
q <- &ErrorEvent{err}
|
q <- &ErrorEvent{err}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user