Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/883#discussion_r108349694
  
    --- Diff: app/addons/auth/base.js ---
    @@ -19,58 +19,46 @@ Auth.session = new Auth.Session();
     FauxtonAPI.setSession(Auth.session);
     app.session = Auth.session;
     
    -Auth.initialize = function () {
     
    -  FauxtonAPI.addHeaderLink({
    -    id: 'auth',
    -    title: 'Login',
    -    href: '#/login',
    -    icon: 'fonticon-user',
    -    bottomNav: true
    -  });
    +function cleanupAuthSection () {
    +  FauxtonAPI.removeHeaderLink({ id: 'auth', bottomNav: true });
    +}
    +
    +Auth.initialize = function () {
     
       Auth.session.on('change', function () {
    -    var session = Auth.session;
    -    var link = {};
    +    const session = Auth.session;
     
         if (session.isAdminParty()) {
    -      link = {
    +      const link = {
             id: 'auth',
             title: 'Admin Party!',
             href: '#/createAdmin',
             icon: 'fonticon-user',
             bottomNav: true
           };
    +
    +      cleanupAuthSection();
    +      FauxtonAPI.addHeaderLink(link);
    +      FauxtonAPI.hideLogin();
    +
         } else if (session.isLoggedIn()) {
    -      link = {
    +      const link = {
    --- End diff --
    
    This doesn't seem  correct, the `link` variable is declared twice and then 
used outside its scope 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to