File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 7
7
SDK_ERROR ,
8
8
} from './actionTypes' ;
9
9
import { INIT_USER , UPDATE_USER_INFO , RESET_USER } from '../user/actionTypes' ;
10
+ import { isTextuallyNull } from '../../../utils' ;
10
11
11
12
const APP_VERSION_STRING = '__uikit_app_version__' ;
12
13
const IS_ROLLUP = '__is_rollup__' ;
@@ -66,7 +67,9 @@ export const handleConnection = ({
66
67
userDispatcher ( { type : INIT_USER , payload : user } ) ;
67
68
// use nickname/profileUrl if provided
68
69
// 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
+ ) {
70
73
newSdk . updateCurrentUserInfo ( nickname || user . nickname , profileUrl || user . profileUrl )
71
74
. then ( ( namedUser ) => {
72
75
userDispatcher ( { type : UPDATE_USER_INFO , payload : namedUser } ) ;
Original file line number Diff line number Diff line change @@ -96,6 +96,13 @@ const OutgoingMessageStates: OutgoingMessageStates = {
96
96
97
97
export type CoreMessageType = AdminMessage | UserMessage | FileMessage ;
98
98
99
+ export const isTextuallyNull = ( text : string ) : boolean => {
100
+ if ( text === '' || text === null ) {
101
+ return true ;
102
+ }
103
+ return false ;
104
+ } ;
105
+
99
106
export const isImage = ( type : string ) : boolean => SUPPORTED_MIMES . IMAGE . indexOf ( type ) >= 0 ;
100
107
export const isVideo = ( type : string ) : boolean => SUPPORTED_MIMES . VIDEO . indexOf ( type ) >= 0 ;
101
108
export const isGif = ( type : string ) : boolean => type === 'image/gif' ;
You can’t perform that action at this time.
0 commit comments