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

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
Peng Xiao
2023-06-08 17:54:25 +08:00
committed by GitHub
parent fda89b05e7
commit bedf838fe5
45 changed files with 221 additions and 134 deletions
+6 -2
View File
@@ -204,7 +204,9 @@ export const WorkspaceLayout: FC<PropsWithChildren> =
useEffect(() => {
document.documentElement.lang = i18n.language;
// todo(himself65): this is a hack, we should use a better way to set the language
setUpLanguage(i18n);
setUpLanguage(i18n)?.catch(error => {
console.error(error);
});
}, [i18n]);
useTrackRouterHistoryEffect();
const currentWorkspaceId = useAtomValue(rootCurrentWorkspaceIdAtom);
@@ -247,7 +249,9 @@ export const WorkspaceLayout: FC<PropsWithChildren> =
logger.info('mount first data:', items);
}
fetch();
fetch().catch(e => {
logger.error('fetch error:', e);
});
return () => {
controller.abort();
logger.info('unmount');