mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 19:10:47 +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:
@@ -15,7 +15,7 @@ import { ToolId } from "@app/types/toolId";
|
||||
import { getToolDisabledReason, getDisabledLabel } from "@app/components/tools/fullscreen/shared";
|
||||
import { useAppConfig } from "@app/contexts/AppConfigContext";
|
||||
import { CloudBadge } from "@app/components/shared/CloudBadge";
|
||||
import { useToolCloudStatus } from "@app/hooks/useToolCloudStatus";
|
||||
import { useWillUseCloud } from "@app/hooks/useWillUseCloud";
|
||||
|
||||
interface ToolButtonProps {
|
||||
id: ToolId;
|
||||
@@ -41,8 +41,9 @@ const ToolButton: React.FC<ToolButtonProps> = ({ id, tool, isSelected, onSelect,
|
||||
const fav = isFavorite(id as ToolId);
|
||||
|
||||
// Check if this tool will route to SaaS backend (desktop only)
|
||||
const endpointName = tool.endpoints?.[0];
|
||||
const usesCloud = useToolCloudStatus(endpointName);
|
||||
const rawEndpoint = tool.operationConfig?.endpoint;
|
||||
const endpointString = typeof rawEndpoint === 'string' ? rawEndpoint : undefined;
|
||||
const usesCloud = useWillUseCloud(endpointString);
|
||||
|
||||
const handleClick = (id: ToolId) => {
|
||||
if (isUnavailable) return;
|
||||
|
||||
Reference in New Issue
Block a user