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

Any good way to rename a queue element? #69

Closed
luishcastroc opened this issue Nov 18, 2019 · 1 comment
Closed

Any good way to rename a queue element? #69

luishcastroc opened this issue Nov 18, 2019 · 1 comment

Comments

@luishcastroc
Copy link

probably this is a silly question and not the place to put it, but is there any consistent way to rename the file once is in the queue already?

i'm using NGXS to handle the uploads with an application store and i'm copying the content of the uploadService queue into my own thing, however my rename functionality gets overwritten by what it is inside the queue at the time i restart the upload.

the endpoint gets updated properly and the file sent to the server have the proper name, but visually my user will still see the old name.

hope this makes sense since this is not a bug.

i can't copy my code since is a corporate application.

but the state is just a copy of the queue.

i'm using the latest of the library.

@kukhariev
Copy link
Owner

kukhariev commented Nov 18, 2019

Hi!
If you change the metadata of a file, you should also reset its url. Otherwise the server will ignore the changes.

  rename(id: string, newName: string) {
    const [target] = this.uploadService.queue.filter(({ uploadId }) => uploadId === id);
    target.metadata.name = newName;
    target.url = '';
    target.status = 'queue';
  }

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

2 participants