@@ -32,14 +32,14 @@ import { casesContextReducer, getInitialCasesContextState } from './cases_contex
3232import { isRegisteredOwner } from '../../files' ;
3333import { casesQueryClient } from './query_client' ;
3434
35- export type CasesContextValueDispatch = Dispatch < CasesContextStoreAction > ;
35+ type CasesContextValueDispatch = Dispatch < CasesContextStoreAction > ;
3636
37- export interface CasesContextValue {
37+ interface CasesContextValue {
3838 externalReferenceAttachmentTypeRegistry : ExternalReferenceAttachmentTypeRegistry ;
3939 persistableStateAttachmentTypeRegistry : PersistableStateAttachmentTypeRegistry ;
4040 owner : string [ ] ;
41- appId : string ;
42- appTitle : string ;
41+ appId ? : string ;
42+ appTitle ? : string ;
4343 permissions : CasesPermissions ;
4444 basePath : string ;
4545 features : CasesFeaturesAllRequired ;
@@ -63,11 +63,6 @@ export interface CasesContextProps
6363
6464export const CasesContext = React . createContext < CasesContextValue | undefined > ( undefined ) ;
6565
66- export interface CasesContextStateValue extends Omit < CasesContextValue , 'appId' | 'appTitle' > {
67- appId ?: string ;
68- appTitle ?: string ;
69- }
70-
7166export const CasesProvider : React . FC < { value : CasesContextProps } > = ( {
7267 children,
7368 value : {
@@ -139,7 +134,7 @@ export const CasesProvider: React.FC<{ value: CasesContextProps }> = ({
139134 [ getFilesClient , owner ]
140135 ) ;
141136
142- return isCasesContextValue ( value ) ? (
137+ return (
143138 < QueryClientProvider client = { casesQueryClient } >
144139 < CasesContext . Provider value = { value } >
145140 { applyFilesContext (
@@ -150,13 +145,10 @@ export const CasesProvider: React.FC<{ value: CasesContextProps }> = ({
150145 ) }
151146 </ CasesContext . Provider >
152147 </ QueryClientProvider >
153- ) : null ;
148+ ) ;
154149} ;
155- CasesProvider . displayName = 'CasesProvider' ;
156150
157- function isCasesContextValue ( value : CasesContextStateValue ) : value is CasesContextValue {
158- return value . appId != null && value . appTitle != null && value . permissions != null ;
159- }
151+ CasesProvider . displayName = 'CasesProvider' ;
160152
161153// eslint-disable-next-line import/no-default-export
162154export default CasesProvider ;
0 commit comments