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

Products with no logo never get marked as loaded #405

Closed
RyanCoulsonCA opened this issue Sep 25, 2024 · 0 comments
Closed

Products with no logo never get marked as loaded #405

RyanCoulsonCA opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working Priority: High This task is high priority and should be tackled soon

Comments

@RyanCoulsonCA
Copy link
Member

Description

Discovered this issue while testing Gordon's metadata PR.

In loadConfig, which gets called when you enter a UUID and click Load, we have the following code block:

if (this.loadExisting && !this.renamed) {
      this.loadStatus = 'waiting';
      Message.success('Successfully loaded storyline!');
   } else {
      this.loadStatus = 'loaded';
}

loadConfig also calls useConfig, which has the following code block:

if (logoFile) {
    logoFile.async('blob').then((img: Blob) => {
        this.logoImage = new File([img], logoName);
        this.metadata.logoPreview = URL.createObjectURL(img);
        this.metadata.logoName = logoName;
        this.loadStatus = 'loaded';
    });
}

Based on this it seems that if you load an existing product that doesn't have a logo, it will never have its loadStatus set to loaded. This explains why the rename button doesn't appear for the TCEI product (which we previously thought was a race condition relating to large products) since it appears only once the product has been set to loaded.

Environment

  • Browser (if applicable): Any

Steps to reproduce

  1. Create a product with no logo and save it.
  2. Go back to the home page and click Load an existing product and load your new Storylines product.
  3. Notice that once everything loads, the rename button doesn't appear under the UUID input.
  4. Now, add a logo and press Save.
  5. Once again, go back to the home page and click Load an existing product and load the product one more time.
  6. Notice that the rename button now appears.

Expected behavior

When loading a product, the load status should always be set to loaded.

Actual behavior

The load status will only be set to loaded if the product has a logo.

@RyanCoulsonCA RyanCoulsonCA added Bug Something isn't working Priority: High This task is high priority and should be tackled soon labels Sep 25, 2024
@RyanCoulsonCA RyanCoulsonCA self-assigned this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Priority: High This task is high priority and should be tackled soon
Projects
None yet
Development

No branches or pull requests

2 participants