Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ilee2u committed Dec 13, 2024
1 parent d38ce63 commit 412da04
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const Sidebar = ({
show all the audit trial data, expired or not.
*/
const getDaysRemainingMessage = () => {

Check failure on line 93 in src/components/Sidebar/index.jsx

View workflow job for this annotation

GitHub Actions / test

Block must not be padded by blank lines
console.log("auditTrialDaysRemaining", auditTrialDaysRemaining)

if (auditTrialDaysRemaining > 1) {
const irtl = new Intl.RelativeTimeFormat({ style: 'long' });
Expand Down
7 changes: 4 additions & 3 deletions src/data/thunks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';

import { camelCaseObject } from '@edx/frontend-platform';
import trackChatBotMessageOptimizely from '../utils/optimizelyExperiment';
import {
fetchChatResponse,
Expand All @@ -20,7 +21,6 @@ import {
setAuditTrialLengthDays,
} from './slice';
import { OPTIMIZELY_PROMPT_EXPERIMENT_KEY } from './optimizely';
import { camelCaseObject } from '@edx/frontend-platform';

export function addChatMessage(role, content, courseId, promptExperimentVariationKey = undefined) {
return (dispatch, getState) => {
Expand Down Expand Up @@ -72,6 +72,7 @@ export function getChatResponse(courseId, unitId, promptExperimentVariationKey =
// Refresh chat summary only on the first message so we can tell if the user has initiated an audit trial
// NOTE: This is a bit of a hacky solution that may be refined later
if (messageList.length === 1) {
// eslint-disable-next-line no-use-before-define
dispatch(getLearningAssistantChatSummary(courseId));
}

Expand Down Expand Up @@ -143,8 +144,8 @@ export function getLearningAssistantChatSummary(courseId) {

// Validate audit trial data & dates
const auditTrialDatesValid = !(
Number.isNaN(Date.parse(auditTrial.startDate)) ||
Number.isNaN(Date.parse(auditTrial.expirationDate))
Number.isNaN(Date.parse(auditTrial.startDate))
|| Number.isNaN(Date.parse(auditTrial.expirationDate))
);

if (Object.keys(auditTrial).length !== 0 && auditTrialDatesValid) {
Expand Down
1 change: 0 additions & 1 deletion src/hooks/use-course-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default function useCourseUpgrade() {
auditTrialDaysRemaining = Math.ceil((auditTrialExpirationDate - Date.now()) / millisecondsInOneDay);

auditTrialExpired = auditTrialDaysRemaining < 0;
console.log({upgradeUrl}, {auditTrialDaysRemaining})
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/Xpert.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import { useEffect, useMemo, useState } from 'react';
import { useEffect, useMemo } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { updateSidebarIsOpen, getLearningAssistantChatSummary } from '../data/thunks';
Expand Down

0 comments on commit 412da04

Please sign in to comment.