Skip to content

Commit 121fa8e

Browse files
authored
Merge pull request #48 from coreofscience/store-stars-in-firebase
task finished
2 parents a0dec2e + 3e24240 commit 121fa8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/tree/Tree.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const Tree: FC<Props> = ({ data, treeId }: Props) => {
7575
useEffect(() => {
7676
if (!firebase) return;
7777
const ref = firebase.database().ref(`stars/${treeId}`);
78-
ref.on("value", (snapshot) => setStar(snapshot.val()));
78+
ref.on("value", (snapshot) => setStar(snapshot.val() || {}));
7979
return () => {
8080
ref.off();
8181
};

0 commit comments

Comments
 (0)