@@ -33,10 +33,12 @@ export const feedbackIntegration = (
33
33
} ;
34
34
} ;
35
35
36
+ const _getClientIntegration = ( ) : FeedbackIntegration => {
37
+ return getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > ( MOBILE_FEEDBACK_INTEGRATION_NAME ) ;
38
+ } ;
39
+
36
40
export const getFeedbackOptions = ( ) : Partial < FeedbackWidgetProps > => {
37
- const integration = getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > (
38
- MOBILE_FEEDBACK_INTEGRATION_NAME ,
39
- ) ;
41
+ const integration = _getClientIntegration ( ) ;
40
42
if ( ! integration ) {
41
43
return { } ;
42
44
}
@@ -45,9 +47,7 @@ export const getFeedbackOptions = (): Partial<FeedbackWidgetProps> => {
45
47
} ;
46
48
47
49
export const getFeedbackButtonOptions = ( ) : Partial < FeedbackButtonProps > => {
48
- const integration = getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > (
49
- MOBILE_FEEDBACK_INTEGRATION_NAME ,
50
- ) ;
50
+ const integration = _getClientIntegration ( ) ;
51
51
if ( ! integration ) {
52
52
return { } ;
53
53
}
@@ -56,9 +56,7 @@ export const getFeedbackButtonOptions = (): Partial<FeedbackButtonProps> => {
56
56
} ;
57
57
58
58
export const getColorScheme = ( ) : 'system' | 'light' | 'dark' => {
59
- const integration = getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > (
60
- MOBILE_FEEDBACK_INTEGRATION_NAME ,
61
- ) ;
59
+ const integration = _getClientIntegration ( ) ;
62
60
if ( ! integration ) {
63
61
return 'system' ;
64
62
}
@@ -67,9 +65,7 @@ export const getColorScheme = (): 'system' | 'light' | 'dark' => {
67
65
} ;
68
66
69
67
export const getFeedbackLightTheme = ( ) : Partial < FeedbackWidgetTheme > => {
70
- const integration = getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > (
71
- MOBILE_FEEDBACK_INTEGRATION_NAME ,
72
- ) ;
68
+ const integration = _getClientIntegration ( ) ;
73
69
if ( ! integration ) {
74
70
return { } ;
75
71
}
@@ -78,9 +74,7 @@ export const getFeedbackLightTheme = (): Partial<FeedbackWidgetTheme> => {
78
74
} ;
79
75
80
76
export const getFeedbackDarkTheme = ( ) : Partial < FeedbackWidgetTheme > => {
81
- const integration = getClient ( ) ?. getIntegrationByName < ReturnType < typeof feedbackIntegration > > (
82
- MOBILE_FEEDBACK_INTEGRATION_NAME ,
83
- ) ;
77
+ const integration = _getClientIntegration ( ) ;
84
78
if ( ! integration ) {
85
79
return { } ;
86
80
}
0 commit comments