Skip to content

Commit

Permalink
Merge pull request #30 from AgileBits/task/update-first-and-lastname-…
Browse files Browse the repository at this point in the history
…retrieval-logic

A better way for retrieving saved data from 1Password.
  • Loading branch information
roustem committed Aug 1, 2014
2 parents 5119e31 + 5bfa7a7 commit dab30f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ - (IBAction)saveLoginTo1Password:(id)sender {
}

__strong typeof(self) strongMe = miniMe;
strongMe.firstnameTextField.text = loginDict[AppExtensionFieldsKey][@"firstname"] ? : strongMe.firstnameTextField.text;
strongMe.lastnameTextField.text = loginDict[AppExtensionFieldsKey][@"lastname"] ? : strongMe.lastnameTextField.text;
strongMe.usernameTextField.text = loginDict[AppExtensionUsernameKey] ? : strongMe.usernameTextField.text;
strongMe.passwordTextField.text = loginDict[AppExtensionPasswordKey] ? : strongMe.passwordTextField.text;

strongMe.firstnameTextField.text = loginDict[AppExtensionReturnedFieldsKey][@"firstname"] ? : @"";
strongMe.lastnameTextField.text = loginDict[AppExtensionReturnedFieldsKey][@"lastname"] ? : @""
strongMe.usernameTextField.text = loginDict[AppExtensionUsernameKey] ? : @"";
strongMe.passwordTextField.text = loginDict[AppExtensionPasswordKey] ? : @"";
}];
}

Expand Down
1 change: 1 addition & 0 deletions OnePasswordExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FOUNDATION_EXPORT NSString *const AppExtensionTitleKey;
FOUNDATION_EXPORT NSString *const AppExtensionNotesKey;
FOUNDATION_EXPORT NSString *const AppExtensionSectionTitleKey;
FOUNDATION_EXPORT NSString *const AppExtensionFieldsKey;
FOUNDATION_EXPORT NSString *const AppExtensionReturnedFieldsKey;

// Password Generator options
FOUNDATION_EXPORT NSString *const AppExtensionGeneratedPasswordMinLengthKey;
Expand Down
1 change: 1 addition & 0 deletions OnePasswordExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
NSString *const AppExtensionNotesKey = @"notes";
NSString *const AppExtensionSectionTitleKey = @"section_title";
NSString *const AppExtensionFieldsKey = @"fields";
NSString *const AppExtensionReturnedFieldsKey = @"returned_fields";

// WebView Dictionary keys
NSString *const AppExtensionWebViewPageFillScript = @"fillScript";
Expand Down

0 comments on commit dab30f6

Please sign in to comment.