aboutsummaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/util.go b/util.go
index 4e23bb1..cd16a59 100644
--- a/util.go
+++ b/util.go
@@ -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")
}
}