Commits

Devin Martin committed ae64e20

Oops, forgot a few files.

  • Participants
  • Parent commits ca8399d

Comments (0)

Files changed (2)

     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Constants.cs" />
     <Compile Include="KeeOtpExt.cs" />
     <Compile Include="ShowOneTimePasswords.cs">
       <SubType>Form</SubType>

ShowOneTimePasswords.cs

 
         private void FormWasShown()
         {
-            if (!entry.Strings.Exists("OTP"))
+            if (!entry.Strings.Exists(Constants.OtpDictionaryKey))
             {
                 this.Close();
                 MessageBox.Show("Please add a one time password field");
             {
                 try
                 {
-                    var otpEncodedKey = entry.Strings.Get("OTP");
+                    var otpEncodedKey = entry.Strings.Get(Constants.OtpDictionaryKey);
                     var key = Base32.Decode(otpEncodedKey.ReadString());
                     this.totp = new Totp(key);
                     this.timerUpdateTotp.Enabled = true;
                 catch (Exception e)
                 {
                     MessageBox.Show(e.Message);
+                    this.Close();
                 }
             }