Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit icon duplicates when editing existing upload #24

Open
bilogic opened this issue Sep 10, 2023 · 1 comment
Open

Edit icon duplicates when editing existing upload #24

bilogic opened this issue Sep 10, 2023 · 1 comment

Comments

@bilogic
Copy link

bilogic commented Sep 10, 2023

onManageMetadata: async (item) => {
        
    let currentCaption = item.getMetadata('caption');
    let newCaption = window.prompt('Edit file caption', currentCaption);

    if (newCaption && newCaption != currentCaption) {
        item.setMetadata('caption', newCaption);
    }
},

I'm using filepond through another project https://github.com/filamentphp/filament and have a file that is already on the server.

When I add the code above and try to setMetadata, the icon duplicates.
A video here to make explanation easier https://imgur.com/a/ylKLwGz

Any idea what the cause might be?

@bilogic
Copy link
Author

bilogic commented Sep 10, 2023

view.registerWriter(
createRoute({
DID_LOAD_ITEM: didLoadItem
}, ({ root, props }) => {
const { id } = props;

I changed DID_LOAD_ITEM to DID_INIT_ITEM and the issue is no longer there.
I can't find any documentation on DID_xxx at all. Which one should it be?

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

No branches or pull requests

1 participant