Skip to content

Conversation

@dariox64
Copy link

This commit introduces necessary logic to refresh the file list in the media picker's gallery view and reset pagination after the following actions:

  1. Uploading New Files (via addFilesAction): After successfully creating new media records, the gallery now explicitly calls $this->resetPage() and re-fetches the file list with $this->files = $this->getFiles(). This ensures newly uploaded items appear immediately, respecting the configured sorting and pagination limit.
  2. Deleting a File (via destroyItemAction): The file list is now refreshed and the selected state is cleared after a successful deletion, ensuring the gallery reflects the current state of the database.

Fixes an issue where users had to manually search or reload the page to see newly uploaded files or confirm that a deletion was successful.

This commit introduces necessary logic to refresh the file list in the media picker's gallery view and reset pagination after the following actions:

1.  **Uploading New Files** (via `addFilesAction`): After successfully creating new media records, the gallery now explicitly calls `$this->resetPage()` and re-fetches the file list with `$this->files = $this->getFiles()`. This ensures newly uploaded items appear immediately, respecting the configured sorting and pagination limit.
2.  **Deleting a File** (via `destroyItemAction`): The file list is now refreshed and the selected state is cleared after a successful deletion, ensuring the gallery reflects the current state of the database.

Fixes an issue where users had to manually search or reload the page to see newly uploaded files or confirm that a deletion was successful.
@awcodes
Copy link
Owner

awcodes commented Dec 12, 2025

Can you provide a video of the issue? I'm not quite following what the issue is.

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