mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 16:40:41 +08:00
update example
This commit is contained in:
parent
a4c4ab6c8f
commit
acad85e603
@ -30,6 +30,9 @@ func main() {
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
},
|
||||
Windows: application.WindowsOptions{
|
||||
WndClass: "Notifications",
|
||||
},
|
||||
})
|
||||
|
||||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
@ -65,7 +68,7 @@ func main() {
|
||||
Data: map[string]interface{}{
|
||||
"messageId": "msg-123",
|
||||
"senderId": "user-123",
|
||||
"timestamp": time.Now().String(),
|
||||
"timestamp": time.Now().Unix(),
|
||||
},
|
||||
})
|
||||
|
||||
@ -92,7 +95,7 @@ func main() {
|
||||
Data: map[string]interface{}{
|
||||
"messageId": "msg-456",
|
||||
"senderId": "user-456",
|
||||
"timestamp": time.Now().String(),
|
||||
"timestamp": time.Now().Unix(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func (ns *Service) ServiceStartup(ctx context.Context, options application.Servi
|
||||
return fmt.Errorf("failed to connect to D-Bus session bus: %v", err)
|
||||
}
|
||||
|
||||
appName := "Wails Application"
|
||||
appName := application.Get().Config().Name
|
||||
|
||||
var iconPath string
|
||||
|
||||
@ -52,14 +52,13 @@ func (ns *Service) ServiceStartup(ctx context.Context, options application.Servi
|
||||
ActionIdentifier: action,
|
||||
}
|
||||
|
||||
if action == "default" {
|
||||
if action == "" {
|
||||
response.ActionIdentifier = DefaultActionIdentifier
|
||||
}
|
||||
|
||||
if target.Signature().String() == "s" {
|
||||
var targetStr string
|
||||
if err := target.Store(&targetStr); err == nil {
|
||||
// Try to parse as JSON
|
||||
var userInfo map[string]interface{}
|
||||
if err := json.Unmarshal([]byte(targetStr), &userInfo); err == nil {
|
||||
response.UserInfo = userInfo
|
||||
|
Loading…
Reference in New Issue
Block a user