Update
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user