mirror of
https://github.com/taigrr/wails.git
synced 2026-04-04 06:02:43 -07:00
Compare commits
1 Commits
419-encodi
...
463---keep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0908470ea |
@@ -29,5 +29,3 @@ Wails is what it is because of the time and effort given by these great people.
|
||||
* [dedo1911](https://github.com/dedo1911)
|
||||
* [Florian Didron](https://github.com/fdidron)
|
||||
* [Christopher Murphy](https://github.com/Splode)
|
||||
* [Zámbó, Levente](https://github.com/Lyimmi)
|
||||
* [artem](https://github.com/Unix4ever)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cmd
|
||||
|
||||
// Version - Wails version
|
||||
const Version = "v1.7.2-pre2"
|
||||
const Version = "v1.7.1"
|
||||
|
||||
@@ -152,19 +152,12 @@ func (h *Bridge) NotifyEvent(event *messages.EventData) error {
|
||||
// Marshall the data
|
||||
data, err = json.Marshal(event.Data)
|
||||
if err != nil {
|
||||
h.log.Errorf("Cannot marshal JSON data in event: %s ", err.Error())
|
||||
h.log.Errorf("Cannot unmarshall JSON data in event: %s ", err.Error())
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Double encode data to ensure everything is escaped correctly.
|
||||
data, err = json.Marshal(string(data))
|
||||
if err != nil {
|
||||
h.log.Errorf("Cannot marshal JSON data in event: %s ", err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
message := "window.wails._.Notify('" + event.Name + "'," + string(data) + ")"
|
||||
message := fmt.Sprintf("window.wails._.Notify('%s','%s')", event.Name, data)
|
||||
dead := []*session{}
|
||||
for _, session := range h.sessions {
|
||||
err := session.evalJS(message, notifyMessage)
|
||||
|
||||
@@ -329,14 +329,7 @@ func (w *WebView) NotifyEvent(event *messages.EventData) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Double encode data to ensure everything is escaped correctly.
|
||||
data, err = json.Marshal(string(data))
|
||||
if err != nil {
|
||||
w.log.Errorf("Cannot marshal JSON data in event: %s ", err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
message := "window.wails._.Notify('" + event.Name + "'," + string(data) + ")"
|
||||
message := fmt.Sprintf("wails._.Notify('%s','%s')", event.Name, data)
|
||||
return w.evalJS(message)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user