Skip to content
This repository

rename loggedInEmail to loggedInUser with backcompat support. issue #18... #1806

Merged
merged 2 commits into from almost 2 years ago

4 participants

Lloyd Hilaiel Dan Callahan Ben Adida Shane Tomlinson
Lloyd Hilaiel
lloyd commented June 20, 2012

...05

resources/static/include_js/include.js
@@ -1027,13 +1027,25 @@
1027 1027
 
1028 1028
       _open_hidden_iframe();
1029 1029
 
  1030
+      // back compat support for loggedInEmail
  1031
+      if (typeof options.loggedInEmail !== 'undefined' &&
  1032
+          typeof options.loggedInUser !== 'undefined')
  1033
+      {
  1034
+        throw "you cannot supply *both* loggedInEmail and loggedInUser";
  1035
+      }
  1036
+      else if(typeof options.loggedInEmail !== 'undefined')
  1037
+      {
  1038
+        options.loggedInUser = options.loggedInEmail;
  1039
+        delete options.loggedInEmail;
  1040
+      }
1
Dan Callahan Owner
callahad added a note June 20, 2012

Looks good! Pedantry -- shouldn't this be using same-line curly braces to match the rest of this file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Dan Callahan
Owner

Should we add a unit test for this? Otherwise, r+.

Ben Adida

@callahad is right, we need tests, I guess this means we wait until early next week to merge, that's probably ok.

Lloyd Hilaiel
lloyd commented June 25, 2012

oh damn. This means we can't really call the .watch() api stable when we roll 2012.06.22 on july 4th.

Shane Tomlinson shane-tomlinson merged commit d3b9a1f into from June 29, 2012
Shane Tomlinson shane-tomlinson closed this June 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 18 additions and 2 deletions. Show diff stats Hide diff stats

  1. 20  resources/static/include_js/include.js
20  resources/static/include_js/include.js
@@ -1027,13 +1027,29 @@
1027 1027
 
1028 1028
       _open_hidden_iframe();
1029 1029
 
  1030
+      // back compat support for loggedInEmail
  1031
+      if (typeof options.loggedInEmail !== 'undefined' &&
  1032
+          typeof options.loggedInUser !== 'undefined') {
  1033
+        throw "you cannot supply *both* loggedInEmail and loggedInUser";
  1034
+      }
  1035
+      else if(typeof options.loggedInEmail !== 'undefined') {
  1036
+        try {
  1037
+          console.log("loggedInEmail has been deprecated");
  1038
+        } catch(e) {
  1039
+          /* ignore error */
  1040
+        }
  1041
+
  1042
+        options.loggedInUser = options.loggedInEmail;
  1043
+        delete options.loggedInEmail;
  1044
+      }
  1045
+
1030 1046
       // check that the commChan was properly initialized before interacting with it.
1031 1047
       // on unsupported browsers commChan might still be undefined, in which case
1032 1048
       // we let the dialog display the "unsupported browser" message upon spawning.
1033  
-      if (typeof options.loggedInEmail !== 'undefined' && commChan) {
  1049
+      if (typeof options.loggedInUser !== 'undefined' && commChan) {
1034 1050
         commChan.notify({
1035 1051
           method: 'loggedInUser',
1036  
-          params: options.loggedInEmail
  1052
+          params: options.loggedInUser
1037 1053
         });
1038 1054
       }
1039 1055
     }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.