Skip to content

Avoid sending local image paths for cloud mode#443

Merged
mjh1 merged 1 commit intomainfrom
mh/image-fix
Feb 12, 2026
Merged

Avoid sending local image paths for cloud mode#443
mjh1 merged 1 commit intomainfrom
mh/image-fix

Conversation

@mjh1
Copy link
Copy Markdown
Contributor

@mjh1 mjh1 commented Feb 11, 2026

Fix the situation where we might reference local image paths on the cloud server, we now:

  • Clear previously selected images on cloud connection state change
  • Refresh the list in the image picker dynamically when the connection state changes rather than only when opening the picker

Copy link
Copy Markdown
Collaborator

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Other than that, LGTM 👍


// Track cloud connection state and clear images when it changes
// (switching between local/cloud means different asset lists)
const { isConnected: isCloudConnected, isConnecting: isCloudConnecting } =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this isCloudConnecting, It's not checked anywhere and it seems it could be enough to have isCloudConnected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, yep that shouldn't be needed

}

prevCloudConnectedRef.current = isCloudConnected;
}, [isCloudConnected, isOpen]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you add loadImages in the dependency array?

Fix the situation where we might reference local image paths on the cloud server, we now clear previously selected images on cloud connection state change and make sure to refresh the list in the image picker dynamically when the connection state changes rather than only when opening the picker

Signed-off-by: Max Holland <[email protected]>
@mjh1 mjh1 merged commit 051b79d into main Feb 12, 2026
6 checks passed
@mjh1 mjh1 deleted the mh/image-fix branch February 12, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants