feat(mobile): use mobile fallback for index, open home when workspace changed (#9106)

This commit is contained in:
CatsJuice
2024-12-13 07:41:06 +00:00
parent 974c6de1d2
commit 6f6f95a8b0
5 changed files with 29 additions and 18 deletions
@@ -61,7 +61,7 @@ const WorkspaceList = ({
const toggleWorkspace = useCallback(
(id: string) => {
if (id !== currentWorkspace.id) {
jumpToPage(id, 'all');
jumpToPage(id, 'home');
}
onClose?.();
},
@@ -1,8 +1,12 @@
import { Component as IndexComponent } from '@affine/core/desktop/pages/index';
import { AppFallback } from '../components/app-fallback';
// Default route fallback for mobile
export const Component = () => {
// TODO: replace with a mobile version
return <IndexComponent defaultIndexRoute={'home'} />;
return (
<IndexComponent defaultIndexRoute={'home'} fallback={<AppFallback />} />
);
};