Skip to content

Commit

Permalink
Fix sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tahierhussain committed Jan 10, 2025
1 parent 29785f6 commit 895ff1b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/src/components/input-output/add-source/AddSource.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ import { useExceptionHandler } from "../../../hooks/useExceptionHandler";
let transformLlmWhispererJsonSchema;
let LLMW_V2_ID;
let PLAN_TYPES;
let useUnstractSubscriptionPlanStore;
let unstractSubscriptionPlanStore;
try {
transformLlmWhispererJsonSchema =
require("../../../plugins/unstract-subscription/helper/transformLlmWhispererJsonSchema").transformLlmWhispererJsonSchema;
LLMW_V2_ID =
require("../../../plugins/unstract-subscription/helper/transformLlmWhispererJsonSchema").LLMW_V2_ID;
PLAN_TYPES =
require("../../../plugins/unstract-subscription/helper/constants").PLAN_TYPES;
useUnstractSubscriptionPlanStore =
require("../../../plugins/store/unstract-subscription-plan-store").useUnstractSubscriptionPlanStore;
unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store");
} catch (err) {
// Ignore if not available
}
Expand Down Expand Up @@ -50,8 +49,8 @@ function AddSource({
const handleException = useExceptionHandler();

let planType;
if (useUnstractSubscriptionPlanStore) {
planType = useUnstractSubscriptionPlanStore(
if (unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore) {
planType = unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore(
(state) => state?.unstractSubscriptionPlan?.planType
);
}
Expand Down

0 comments on commit 895ff1b

Please sign in to comment.