From 8e476f04e8316e64814cd804d9fb252df505f5ee Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Mon, 9 Aug 2021 20:58:47 -0400 Subject: [PATCH] Update Picocrypt.go --- src/unstable/Picocrypt.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/unstable/Picocrypt.go b/src/unstable/Picocrypt.go index a549dbd..7edee18 100644 --- a/src/unstable/Picocrypt.go +++ b/src/unstable/Picocrypt.go @@ -297,15 +297,19 @@ func startUI(){ // Prompt for password giu.Row( giu.Label("Password:"), - giu.SmallButton("Generate").OnClick(func(){ - tmp := genPassword() - password = tmp - cPassword = tmp - passwordStrength = zxcvbn.PasswordStrength(password,nil).Score - giu.Update() - }), - giu.SmallButton("Copy").OnClick(func(){ - clipboard.WriteAll(password) + giu.Custom(func(){ + if mode!="decrypt"{ + giu.SmallButton("Generate").OnClick(func(){ + tmp := genPassword() + password = tmp + cPassword = tmp + passwordStrength = zxcvbn.PasswordStrength(password,nil).Score + giu.Update() + }).Build() + giu.SmallButton("Copy").OnClick(func(){ + clipboard.WriteAll(password) + }).Build() + } }), giu.Dummy(-200,0), giu.Label(keyfilePrompt),