@@ -1483,9 +1483,7 @@ module.exports = baseVw.extend({
14831483 self . options . userModel . fetch ( {
14841484 success : function ( model , response ) {
14851485 if ( self . isRemoved ( ) ) return ;
1486- var user = self . model . get ( 'user' ) ;
1487- user . moderators = model . get ( 'moderators' ) ;
1488- user . moderator_guids = model . get ( 'moderator_guids' ) ;
1486+ self . model . set ( 'user' , model . toJSON ( ) ) ;
14891487 self . getIsModerator ( ) ;
14901488 }
14911489 } ) ;
@@ -1502,23 +1500,15 @@ module.exports = baseVw.extend({
15021500 if ( $targ . hasClass ( 'confirm' ) ) {
15031501 $targ . addClass ( 'loading' ) . removeClass ( 'confirm' ) ;
15041502
1505- modList . moderators = [ ] ;
1506-
1507- __ . each ( this . model . get ( 'user' ) . moderator_guids , function ( mod ) {
1508- if ( mod != self . pageID && ( typeof ( mod ) !== 'object' || mod . guid != self . pageID ) ) {
1509- modList . moderators . push ( mod ) ;
1510- }
1511- } ) ;
1503+ modList . moderators = __ . without ( this . model . get ( 'user' ) . moderator_guids , self . pageID ) ;
15121504
15131505 saveToAPI ( '' , this . model . get ( 'user' ) , this . model . get ( 'user' ) . serverUrl + "settings" ,
15141506 function ( ) {
15151507 // confirmed
15161508 self . options . userModel . fetch ( {
15171509 success : function ( model , response ) {
15181510 if ( self . isRemoved ( ) ) return ;
1519- var user = self . model . get ( 'user' ) ;
1520- user . moderators = model . get ( 'moderators' ) ;
1521- user . moderator_guids = model . get ( 'moderator_guids' ) ;
1511+ self . model . set ( 'user' , model . toJSON ( ) ) ;
15221512 self . getIsModerator ( ) ;
15231513 }
15241514 } ) ;
0 commit comments