implemented service removal
This commit is contained in:
parent
b52380a10b
commit
4fb0920e88
11
app/UI.hs
11
app/UI.hs
|
@ -144,6 +144,7 @@ servMenu :: String -> S.StateT Status IO ()
|
||||||
servMenu x = menu x
|
servMenu x = menu x
|
||||||
[ ( "show password", showPass x >> servMenu x )
|
[ ( "show password", showPass x >> servMenu x )
|
||||||
, ( "edit password", editPassMenu x )
|
, ( "edit password", editPassMenu x )
|
||||||
|
, ( "remove service", removeServ x )
|
||||||
, ( "back", mainMenu )
|
, ( "back", mainMenu )
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -154,6 +155,16 @@ editPassMenu x = menu (x ++ " : Edit Password")
|
||||||
, ( "back", servMenu x )
|
, ( "back", servMenu x )
|
||||||
]
|
]
|
||||||
|
|
||||||
|
removeServ :: String -> S.StateT Status IO ()
|
||||||
|
removeServ x = do
|
||||||
|
go <- req $ confirm $
|
||||||
|
"Are you sure you want to delete the password for " ++ x ++ "?"
|
||||||
|
if go
|
||||||
|
then do
|
||||||
|
S.modify $ over database $ pwRemoveService x
|
||||||
|
mainMenu
|
||||||
|
else servMenu x
|
||||||
|
|
||||||
changeSalt :: String -> S.StateT Status IO ()
|
changeSalt :: String -> S.StateT Status IO ()
|
||||||
changeSalt x = withService x mainMenu $ \d -> do
|
changeSalt x = withService x mainMenu $ \d -> do
|
||||||
salt <- run newPWSalt
|
salt <- run newPWSalt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user