Skip to content

Commit

Permalink
profileSettings to accommodate for the EmailHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
niccolopaganini committed Oct 25, 2023
1 parent 2db9b97 commit a98e38b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions www/js/control/ProfileSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { AppContext } from "../App";
import { shareQR } from "../components/QrCode";
import { storageClear } from "../plugin/storage";
import { getAppVersion } from "../plugin/clientStats";
import React, { useState } from 'react';

//any pure functions can go outside
const ProfileSettings = () => {
Expand All @@ -36,7 +37,6 @@ const ProfileSettings = () => {
//angular services needed
const CarbonDatasetHelper = getAngularService('CarbonDatasetHelper');
const UploadHelper = getAngularService('UploadHelper');
const EmailHelper = getAngularService('EmailHelper');
const NotificationScheduler = getAngularService('NotificationScheduler');
const ControlHelper = getAngularService('ControlHelper');
const StartPrefs = getAngularService('StartPrefs');
Expand All @@ -57,6 +57,7 @@ const ProfileSettings = () => {
const [consentVis, setConsentVis] = useState(false);
const [dateDumpVis, setDateDumpVis] = useState(false);
const [privacyVis, setPrivacyVis] = useState(false);
const [emailVis, setEmailVis] = useState(false);
const [showingSensed, setShowingSensed] = useState(false);
const [showingLog, setShowingLog] = useState(false);
const [editSync, setEditSync] = useState(false);
Expand All @@ -72,6 +73,7 @@ const ProfileSettings = () => {
const [uiConfig, setUiConfig] = useState({});
const [consentDoc, setConsentDoc] = useState({});
const [dumpDate, setDumpDate] = useState(new Date());
const [emailReason, setEmailReason] = useState("");
const appVersion = useRef();

let carbonDatasetString = t('general-settings.carbon-dataset') + ": " + CarbonDatasetHelper.getCurrentCarbonDatasetCode();
Expand Down Expand Up @@ -224,7 +226,8 @@ const ProfileSettings = () => {

const emailLog = function () {
// Passing true, we want to send logs
EmailHelper.sendEmail("loggerDB")
sendEmail("loggerDB");
setEmailVis(false);
};

async function updatePrefReminderTime(storeNewVal=true, newTime){
Expand Down
2 changes: 1 addition & 1 deletion www/js/control/emailService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ function EmailHelper() {
useEffect(() => {
getEmailConfig();
}, []);
}
}

0 comments on commit a98e38b

Please sign in to comment.