mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(core): correctly toggle visibility of starter-bar based on doc.isEmpty (#10439)
This commit is contained in:
@@ -115,7 +115,7 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.root} data-testid="starter-bar">
|
||||
{t['com.affine.page-starter-bar.start']()}
|
||||
<ul className={styles.badges}>
|
||||
{enableAI ? (
|
||||
@@ -166,12 +166,9 @@ export const StarterBar = ({ doc }: { doc: Store }) => {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const disposable = doc.slots.blockUpdated.on(() => {
|
||||
setIsEmpty(doc.isEmpty);
|
||||
return doc.isEmpty$.subscribe(value => {
|
||||
setIsEmpty(value);
|
||||
});
|
||||
return () => {
|
||||
disposable.dispose();
|
||||
};
|
||||
}, [doc]);
|
||||
|
||||
if (!isEmpty || isTemplate) return null;
|
||||
|
||||
Reference in New Issue
Block a user