Skip to content

Commit

Permalink
fix(ui): ignore user setting for commercial, remove unused state
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary Hipp authored and Mary Hipp committed Nov 15, 2024
1 parent 25f6d3b commit 3460f07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ export const CanvasAlertsInvocationProgress = memo(() => {
return null;
}

if (!isLocal) {
return <CanvasAlertsInvocationProgressContentCommercial />;
}

// The alert is disabled at the user level
if (!shouldShowInvocationProgressDetail) {
return null;
}

return isLocal ? <CanvasAlertsInvocationProgressContentLocal /> : <CanvasAlertsInvocationProgressContentCommercial />;
return <CanvasAlertsInvocationProgressContentLocal />;
});

CanvasAlertsInvocationProgress.displayName = 'CanvasAlertsInvocationProgress';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const useDeferredModelLoadingInvocationProgressMessage = () => {
const { t } = useTranslation();
const invocationProgressMessage = useStore($invocationProgressMessage);
const [delayedMessage, setDelayedMessage] = useState<string | null>(null);
const [lastValidMessage, setLastValidMessage] = useState(invocationProgressMessage);

useEffect(() => {
if (!invocationProgressMessage) {
Expand All @@ -20,15 +19,13 @@ export const useDeferredModelLoadingInvocationProgressMessage = () => {
return;
}

setLastValidMessage(invocationProgressMessage);

// Set a timeout to update delayedMessage after 5 seconds
const timer = setTimeout(() => {
setDelayedMessage(`${t('common.loadingModel')}...`);
}, 5000);

return () => clearTimeout(timer); // Cleanup on effect re-run
}, [invocationProgressMessage, lastValidMessage, t]);
}, [invocationProgressMessage, t]);

return delayedMessage;
};

0 comments on commit 3460f07

Please sign in to comment.