mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 02:48:21 -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)
|
* [dedo1911](https://github.com/dedo1911)
|
||||||
* [Florian Didron](https://github.com/fdidron)
|
* [Florian Didron](https://github.com/fdidron)
|
||||||
* [Christopher Murphy](https://github.com/Splode)
|
* [Christopher Murphy](https://github.com/Splode)
|
||||||
* [Zámbó, Levente](https://github.com/Lyimmi)
|
|
||||||
* [artem](https://github.com/Unix4ever)
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// 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
|
// Marshall the data
|
||||||
data, err = json.Marshal(event.Data)
|
data, err = json.Marshal(event.Data)
|
||||||
if err != nil {
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double encode data to ensure everything is escaped correctly.
|
message := fmt.Sprintf("window.wails._.Notify('%s','%s')", event.Name, data)
|
||||||
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) + ")"
|
|
||||||
dead := []*session{}
|
dead := []*session{}
|
||||||
for _, session := range h.sessions {
|
for _, session := range h.sessions {
|
||||||
err := session.evalJS(message, notifyMessage)
|
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.
|
message := fmt.Sprintf("wails._.Notify('%s','%s')", event.Name, data)
|
||||||
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) + ")"
|
|
||||||
return w.evalJS(message)
|
return w.evalJS(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user