fix(ui): repair typescript definitions
parent
3ae21ba007
commit
9199310bb7
|
@ -1,4 +1,4 @@
|
|||
import {Dispatch} from 'redux'
|
||||
import {Dispatch, Action as ReduxAction} from 'redux'
|
||||
|
||||
import {
|
||||
getMe as getMeAJAX,
|
||||
|
@ -149,7 +149,7 @@ export const getMeAsync = ({shouldResetMe = false} = {}) => async (
|
|||
export const meChangeOrganizationAsync = (
|
||||
url: string,
|
||||
organization: Organization
|
||||
) => async (dispatch): Promise<void> => {
|
||||
) => async (dispatch: Dispatch<ReduxAction>): Promise<void> => {
|
||||
dispatch(meChangeOrganizationRequested())
|
||||
try {
|
||||
const {data: me, auth, logoutLink} = await updateMeAJAX(url, organization)
|
||||
|
@ -166,7 +166,7 @@ export const meChangeOrganizationAsync = (
|
|||
|
||||
// refresh links after every successful meChangeOrganization to refresh
|
||||
// /organizations/:id/users link for Admin / Current Org Users page to load
|
||||
dispatch(getLinksAsync())
|
||||
dispatch((getLinksAsync() as unknown) as ReduxAction) // casted as a workaround for strict type checking in typescript 4.6.2
|
||||
// TODO: reload sources upon me change org if non-refresh behavior preferred
|
||||
// instead of current behavior on both invocations of meChangeOrganization,
|
||||
// which is to refresh index via router.push('')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Dispatch} from 'redux'
|
||||
import {Dispatch, Action as ReduxAction} from 'redux'
|
||||
|
||||
import {getLinks as getLinksAJAX} from 'src/shared/apis/links'
|
||||
|
||||
|
@ -38,9 +38,7 @@ const linksGetFailed = (): LinksGetFailedAction => ({
|
|||
})
|
||||
|
||||
export const getLinksAsync = () => async (
|
||||
dispatch: Dispatch<
|
||||
LinksGetRequestedAction | LinksGetCompletedAction | LinksGetFailedAction
|
||||
>
|
||||
dispatch: Dispatch<ReduxAction>
|
||||
): Promise<void> => {
|
||||
dispatch(linksGetRequested())
|
||||
try {
|
||||
|
|
|
@ -28,7 +28,7 @@ const WidgetCell: FunctionComponent<Props> = ({cell, source, timeRange}) => {
|
|||
)
|
||||
}
|
||||
case 'news': {
|
||||
return <NewsFeed source={source} />
|
||||
return <NewsFeed />
|
||||
}
|
||||
case 'guide': {
|
||||
return <GettingStarted />
|
||||
|
|
Loading…
Reference in New Issue