mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Hotfix-cant-run-tools-when-no-credits (#5955)
Tested: * Can sign in on saas -> can run local tools with or without credits-> can run saas only tools (if credits) -> can't run saas only tools without credits * Can sign in self-hosted -> can run all tools on remote if available -> can run local when self-hosted unavailable Clouds show on saas tools when connected Tools are disabled when connected to self-hosted but cannot find server. You also get banner #cantwaitforplaywritetests
This commit is contained in:
@@ -5,11 +5,11 @@ import { getToolCreditCost } from '@app/utils/creditCosts';
|
||||
import { openPlanSettings } from '@app/utils/appSettings';
|
||||
import type { ToolId } from '@app/types/toolId';
|
||||
|
||||
export function useCreditCheck(operationType?: string) {
|
||||
export function useCreditCheck(operationType?: string, _endpoint?: string) {
|
||||
const { hasSufficientCredits, isPro, creditBalance, refreshCredits } = useCredits();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const checkCredits = useCallback(async (): Promise<string | null> => {
|
||||
const checkCredits = useCallback(async (_runtimeEndpoint?: string): Promise<string | null> => {
|
||||
const requiredCredits = getToolCreditCost(operationType as ToolId);
|
||||
const creditCheck = hasSufficientCredits(requiredCredits);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user