Merge pull request #32734 from woocommerce/fix/admin-type

Fix history type error
This commit is contained in:
Chi-Hsuan Huang 2022-04-22 16:51:07 +08:00 committed by GitHub
commit 7b3ab3aeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import {
import { recordEvent } from '@woocommerce/tracks';
import { List, TaskItem } from '@woocommerce/experimental';
import classnames from 'classnames';
import { History } from 'history';
/**
* Internal dependencies
@ -138,7 +139,9 @@ export const SectionedTaskList: React.FC< TaskListProps > = ( {
if ( task.actionUrl.startsWith( 'http' ) ) {
window.location.href = task.actionUrl;
} else {
getHistory().push( getNewPath( {}, task.actionUrl, {} ) );
( getHistory() as History ).push(
getNewPath( {}, task.actionUrl, {} )
);
}
return;
}