Skip to content

Commit 50ba4ab

Browse files
authored
fix: [auth] global event listener (#106)
Signed-off-by: inkeliz <inkeliz@inkeliz.com>
1 parent faaef33 commit 50ba4ab

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

auth/gioauth/plugin.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,14 @@ func (p *authPlugin) TypeGlobalEvent() []reflect.Type {
9393
}
9494

9595
func (p *authPlugin) GlobalEvent(evt event.Event) {
96-
/*
97-
switch evt := evt.(type) {
98-
99-
case app.URLEvent:
100-
if p.client != nil {
101-
if err := p.client.ProcessCustomSchemeCallback(evt.URL.String()); err != nil {
102-
p.plugin.SendEventUntagged(intName, ErrorEvent(auth.ErrorEvent{Error: err}))
103-
}
104-
} else {
105-
p.startupURL = evt.URL.String()
106-
}
96+
switch evt := evt.(type) {
97+
case app.URLEvent:
98+
if p.client != nil {
99+
if err := p.client.ProcessCustomSchemeCallback(evt.URL.String()); err != nil {
100+
p.plugin.SendEventUntagged(intName, ErrorEvent(auth.ErrorEvent{Error: err}))
101+
}
102+
} else {
103+
p.startupURL = evt.URL.String()
107104
}
108-
*/
105+
}
109106
}

auth/gioauth/plugin_events.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gioauth
22

33
import (
4+
"gioui.org/app"
45
"github.com/gioui-plugins/gio-plugins/auth"
56
"github.com/gioui-plugins/gio-plugins/plugin"
67
"reflect"
@@ -12,7 +13,7 @@ var (
1213
reflect.TypeOf(plugin.EndFrameEvent{}),
1314
}
1415
wantGlobalEvents = []reflect.Type{
15-
// reflect.TypeOf(app.URLEvent{}),
16+
reflect.TypeOf(app.URLEvent{}),
1617
}
1718
)
1819

0 commit comments

Comments
 (0)