Compare commits

...

2 Commits

Author SHA1 Message Date
Mikaël Cluseau
1e904b7361 ui: fix del-key cancel handling 2024-01-07 11:22:57 +01:00
Mikaël Cluseau
8ed0f12fb4 fix add key 2024-01-07 11:18:50 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -29,9 +29,6 @@ func wsStoreAddKey(req *restful.Request, resp *restful.Response) {
return
}
secStore.AddKey(np.Name, np.Passphrase)
defer updateState()
for _, k := range secStore.Keys {
if k.Name == np.Name {
wsBadRequest(resp, "there's already a passphrase named "+strconv.Quote(np.Name))
@ -39,6 +36,9 @@ func wsStoreAddKey(req *restful.Request, resp *restful.Response) {
}
}
secStore.AddKey(np.Name, np.Passphrase)
defer updateState()
err = secStore.SaveTo(secKeysStorePath())
if err != nil {
wsError(resp, err)

View File

@ -79,6 +79,8 @@ createApp({
})
},
storeDelKey() {
event.preventDefault()
let name = this.forms.delKey.name
if (!confirm("Remove key named "+JSON.stringify(name)+"?")) {