diff options
Diffstat (limited to 'util.go')
-rw-r--r-- | util.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -27,15 +27,15 @@ func ezbrSystemRoom(user_mx_id string) (string, error) { } widget_kv_key := "ezbr_widget_on:" + mx_room_id - if config.WebURL != "" && dbKvTestAndSet(widget_kv_key, "yes") { + if config.WebURL != "" && dbKvGet(widget_kv_key) != "yes" { widget := map[string]interface{}{ "type": "m.easybridge", "url": config.WebURL, "name": "Easybridge account configuration dashboard", } err = mx.PutStateAs(mx_room_id, "im.vector.modular.widgets", "ezbr_widget", widget, ezbrMxId()) - if err != nil { - dbKvPut(widget_kv_key, "") + if err == nil { + dbKvPut(widget_kv_key, "yes") } } |