This commit is contained in:
ct
2025-07-15 03:27:39 +08:00
parent eb207b98d9
commit 852346ee3b
13 changed files with 44 additions and 61 deletions

View File

@@ -28,8 +28,7 @@ const EditorAISheet = () => {
const pollingIntervalRef = useRef(null);
const currentJobIdRef = useRef(null);
const { credits } = useUserStore();
const { auth } = usePage().props;
const { credits, user } = useUserStore();
useEffect(() => {
const openSheetListener = () => {
@@ -46,10 +45,10 @@ const EditorAISheet = () => {
// Check for active job on component mount
useEffect(() => {
if (auth.user) {
if (user) {
checkForActiveJob();
}
}, [auth.user]);
}, [user]);
const checkForActiveJob = async () => {
try {
@@ -218,7 +217,7 @@ const EditorAISheet = () => {
</div>
)}
<div className={cn('space-y-2', !prompt.trim() && 'invisible')}>
{auth.user ? (
{user ? (
<>
<Button
onClick={handleSend}