You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,29 @@ You need `NodeJs` and `yarn` installed on your machine.
106
106
npm install --global yarn
107
107
```
108
108
109
+
### Firebase prerequisites (optional)
110
+
111
+
Firebase is used in this project for authentications and to store snippets. In order to contribute in the part requiring Firebase, create a file called `.env` inside the root folder and add the following credentials in it once you create a Firebase app.
It does not matter what credentials you add to your `.env` file, as the app won't crash while developing since the error is taken care of for the Firebase services that are unavailable.
if(!db)returnconsole.log(Error("Firebase is not configured"));// This is to handle error when there is no `.env` file. So, that app doesn't crash while developing without `.env` file.
54
+
55
+
if(!user)return;
56
+
try{
57
+
constdocRef=awaitaddDoc(
58
+
collection(db,"user",user.uid,"snippets"),
59
+
editorConfig
60
+
);
61
+
}catch(e){
62
+
console.error("Error adding document: ",e);
63
+
}
64
+
};
65
+
66
+
constupdateSnippet=async()=>{
67
+
if(!db)returnconsole.log(Error("Firebase is not configured"));// This is to handle error when there is no `.env` file. So, that app doesn't crash while developing without `.env` file.
0 commit comments