feat: add new rule for floating promise (#2726)

Co-authored-by: Himself65 <himself65@outlook.com>
(cherry picked from commit bedf838fe5)
This commit is contained in:
Peng Xiao
2023-06-08 17:54:25 +08:00
committed by himself65
parent 336ff5220f
commit 9429018221
45 changed files with 221 additions and 134 deletions
@@ -43,7 +43,7 @@ export const MessageCenter: FC = memo(function MessageCenter() {
})
.catch(() => {
setPopup(false);
onLogout();
return onLogout();
});
} else {
toast(Messages[event.detail.code].message);
@@ -64,9 +64,11 @@ export const PublishedResults: FC<PublishedResultsProps> = ({
<Command.Item
key={result.id}
onSelect={() => {
router.push(
`/public-workspace/${router.query.workspaceId}/${result.id}`
);
router
.push(
`/public-workspace/${router.query.workspaceId}/${result.id}`
)
.catch(err => console.error(err));
onClose();
}}
value={result.id}
@@ -71,7 +71,9 @@ export const Results: FC<ResultsProps> = ({
value={page.id}
onSelect={() => {
onClose();
jumpToPage(blockSuiteWorkspace.id, page.id);
jumpToPage(blockSuiteWorkspace.id, page.id).catch(
console.error
);
}}
>
<StyledListItem>
@@ -95,7 +97,7 @@ export const Results: FC<ResultsProps> = ({
value={link.title}
onSelect={() => {
onClose();
router.push(link.href);
router.push(link.href).catch(console.error);
}}
>
<StyledListItem>
@@ -133,7 +135,9 @@ export const Results: FC<ResultsProps> = ({
onSelect={() => {
onClose();
assertExists(blockSuiteWorkspace.id);
jumpToPage(blockSuiteWorkspace.id, result.id);
jumpToPage(blockSuiteWorkspace.id, result.id).catch(error =>
console.error(error)
);
}}
value={result.id}
>