File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 77 SDK_ERROR ,
88} from './actionTypes' ;
99import { INIT_USER , UPDATE_USER_INFO , RESET_USER } from '../user/actionTypes' ;
10+ import { isTextuallyNull } from '../../../utils' ;
1011
1112const APP_VERSION_STRING = '__uikit_app_version__' ;
1213const IS_ROLLUP = '__is_rollup__' ;
@@ -66,7 +67,9 @@ export const handleConnection = ({
6667 userDispatcher ( { type : INIT_USER , payload : user } ) ;
6768 // use nickname/profileUrl if provided
6869 // or set userID as nickname
69- if ( ( nickname !== user . nickname || profileUrl !== user . profileUrl ) && ( nickname !== '' || profileUrl !== '' ) ) {
70+ if ( ( nickname !== user . nickname || profileUrl !== user . profileUrl )
71+ && ! ( isTextuallyNull ( nickname ) && isTextuallyNull ( profileUrl ) )
72+ ) {
7073 newSdk . updateCurrentUserInfo ( nickname || user . nickname , profileUrl || user . profileUrl )
7174 . then ( ( namedUser ) => {
7275 userDispatcher ( { type : UPDATE_USER_INFO , payload : namedUser } ) ;
Original file line number Diff line number Diff line change @@ -96,6 +96,13 @@ const OutgoingMessageStates: OutgoingMessageStates = {
9696
9797export type CoreMessageType = AdminMessage | UserMessage | FileMessage ;
9898
99+ export const isTextuallyNull = ( text : string ) : boolean => {
100+ if ( text === '' || text === null ) {
101+ return true ;
102+ }
103+ return false ;
104+ } ;
105+
99106export const isImage = ( type : string ) : boolean => SUPPORTED_MIMES . IMAGE . indexOf ( type ) >= 0 ;
100107export const isVideo = ( type : string ) : boolean => SUPPORTED_MIMES . VIDEO . indexOf ( type ) >= 0 ;
101108export const isGif = ( type : string ) : boolean => type === 'image/gif' ;
You can’t perform that action at this time.
0 commit comments