Skip to content

Commit

Permalink
Switched to users-scheme2 collection in firebase #223 (#227)
Browse files Browse the repository at this point in the history
Co-authored-by: bella.tassone <[email protected]>
  • Loading branch information
bella-tassone and bella.tassone authored Jun 17, 2022
1 parent 728771f commit 3b2be94
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ class ThirdPartyData {
this.count = 0;
this.sCollection = collection(
db,
"users",
"users-scheme2",
userDocId,
"Browser History",
docId,
"Third Party Requests Summary"
);
this.eCollection = collection(
db,
"users",
"users-scheme2",
userDocId,
"Browser History",
docId,
Expand Down Expand Up @@ -179,7 +179,7 @@ export async function createUser(prolificID, schemeNumber) {
let latitude = crd.latitude ? crd.latitude : "unknown latitude";
let date = new Date();
// generate unique user document and storage the id into local storage
const newUserRef = doc(collection(db, "users"));
const newUserRef = doc(collection(db, "users-scheme2"));
console.log("new user reference created: ", newUserRef);
chrome.storage.local.set(
{ USER_DOC_ID: newUserRef.id, UI_SCHEME: schemeNumber },
Expand Down Expand Up @@ -247,7 +247,7 @@ function addHistory(
GPC = "unset";
}
const newBrowserRef = doc(
collection(db, "users", currentUserDocID, "Browser History")
collection(db, "users-scheme2", currentUserDocID, "Browser History")
);
const userData = {
Timestamp: Timestamp.fromDate(date),
Expand Down Expand Up @@ -282,18 +282,18 @@ export function addSettingInteractionHistory(
) {
let date = new Date();
const intDoc1 = doc(
collection(db, "users", currentUserDocID, "Domain Interaction History")
collection(db, "users-scheme2", currentUserDocID, "Domain Interaction History")
);
const intDoc2 = doc(
collection(
db,
"users",
"users-scheme2",
currentUserDocID,
"Privacy Configuration Interaction History"
)
);
const intDoc3 = doc(
collection(db, "users", currentUserDocID, "Mute Interaction History")
collection(db, "users-scheme2", currentUserDocID, "Mute Interaction History")
);
if (subcollection === "Domain") {
const intData = {
Expand Down Expand Up @@ -341,7 +341,7 @@ export function updateDomains(domainsList) {
console.log("updating the domain list");
chrome.storage.local.get(["USER_DOC_ID"], function (result) {
if (result.USER_DOC_ID) {
const userRef = doc(db, "users", result.USER_DOC_ID);
const userRef = doc(db, "users-scheme2", result.USER_DOC_ID);
updateDoc(userRef, {
"Domain List": domainsList,
});
Expand Down Expand Up @@ -428,7 +428,7 @@ export function addAd(adEvent) {
chrome.storage.local.get(["USER_DOC_ID"], function (result) {
const historyRef = collection(
db,
"users",
"users-scheme2",
result.USER_DOC_ID,
"Browser History"
);
Expand All @@ -442,7 +442,7 @@ export function addAd(adEvent) {
querySnapshot.forEach((d) => {
const newBrowserRef = collection(
db,
"users",
"users-scheme2",
result.USER_DOC_ID,
"Browser History",
d.id,
Expand All @@ -460,7 +460,7 @@ export function addAd(adEvent) {
// console.log(adEvent.targetTabId)
const docRef = doc(
db,
"users",
"users-scheme2",
result.USER_DOC_ID,
"Browser History",
d.id,
Expand Down

0 comments on commit 3b2be94

Please sign in to comment.