@@ -2,6 +2,7 @@ import { h, Component } from 'preact';
22import { Card , TextField , Button , Icon , Spinner , CheckBox } from 'preact-mdl' ;
33import Preferences from './preferences' ;
44import { bind } from 'decko' ;
5+ import { parallel } from 'praline' ;
56import peach from '../../peach' ;
67import chooseFiles from 'choose-files' ;
78
@@ -13,8 +14,10 @@ export default class Settings extends Component {
1314 @bind
1415 update ( ) {
1516 this . setState ( { loading : true } ) ;
16- peach . user . me ( ( error , { name, displayName, bio, avatarSrc, isPublic } ) => {
17- let visibility = { friendsOnly : isPublic } ;
17+ parallel ( [
18+ peach . getVisibility ,
19+ peach . user . me
20+ ] , ( error , visibility , { name, displayName, bio, avatarSrc, isPublic } ) => {
1821 this . setState ( { loading :false , error, visibility, name, displayName, bio, avatarSrc } ) ;
1922 } ) ;
2023 }
@@ -93,7 +96,7 @@ export default class Settings extends Component {
9396 < div class = { { error :1 , showing :error } } > { error || ' ' } </ div >
9497
9598 < form action = "javascript:" >
96- < CheckBox checked = { visibility . friendsOnly } onChange = { this . setVisibility } > Visible to Friends Only</ CheckBox >
99+ < CheckBox checked = { visibility . friendsOnly } onClick = { this . setVisibility } > Visible to Friends Only</ CheckBox >
97100 </ form >
98101
99102 < form action = "javascript:" >
0 commit comments