Skip to content

Commit

Permalink
fix(picker-image): prevent caching of image
Browse files Browse the repository at this point in the history
  • Loading branch information
realappie committed Nov 9, 2021
1 parent 9754a85 commit 834a2fb
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/components/picker-customer-logo/picker-customer-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class PickerCustomerLogo {

private async loadImageSrc() {
try {
// const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

// await wait(400000);
console.log(`[eva-picker-customer-logo] getting customer logo for ${this.customerName} with logoPath ${this.logoPath}`);
this.logoSrc = await getDownloadURL(ref(firebaseServiceInstance.storage, this.logoPath));
} catch (error) {
console.error(`[eva-picker-customer-logo] error getting customer logo for ${this.customerName}`, error);
Expand All @@ -40,8 +38,8 @@ export class PickerCustomerLogo {
<Host>
<div class="placeholder" style={{
'opacity': this.logoSrc ? '0' : '1',
}}></div>

}}>
</div>
{this.renderImage()}
</Host>
);
Expand Down
31 changes: 31 additions & 0 deletions src/components/picker-customer-logo/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# picker-customer-logo



<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| -------------- | --------------- | ----------- | -------- | ----------- |
| `customerName` | `customer-name` | | `string` | `undefined` |
| `logoPath` | `logo-path` | | `string` | `undefined` |


## Dependencies

### Used by

- [eva-config-picker-customer](../picker-customers)

### Graph
```mermaid
graph TD;
eva-config-picker-customer --> picker-customer-logo
style picker-customer-logo fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
3 changes: 3 additions & 0 deletions src/components/picker-customers/picker-customers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ button.md {
}

.base-environments-list-item {
border-bottom: 1px solid var(--border-color);
padding-bottom: 8px;

h4, p {
margin: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/picker-customers/picker-customers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Customers {
<div class="back-icon">&#10132;</div>
</button>
<div class="card">
<picker-customer-logo logoPath={this.selectedCustomer.logoPath} customerName={this.selectedCustomer.name}/>
<picker-customer-logo key={this.selectedCustomer.name} logoPath={this.selectedCustomer.logoPath} customerName={this.selectedCustomer.name}/>
<h3>{this.selectedCustomer.name}</h3>
</div>

Expand Down
2 changes: 2 additions & 0 deletions src/components/picker-customers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
### Depends on

- [eva-config-picker-spinner](../picker-spinner)
- [picker-customer-logo](../picker-customer-logo)
- [eva-config-picker-endpoint-status](../picker-endpoint-status)

### Graph
```mermaid
graph TD;
eva-config-picker-customer --> eva-config-picker-spinner
eva-config-picker-customer --> picker-customer-logo
eva-config-picker-customer --> eva-config-picker-endpoint-status
eva-config-picker-endpoint-status --> eva-config-picker-spinner
eva-config-picker --> eva-config-picker-customer
Expand Down
1 change: 1 addition & 0 deletions src/components/picker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ graph TD;
eva-config-picker --> eva-config-picker-customer
eva-config-picker --> eva-config-picker-login
eva-config-picker-customer --> eva-config-picker-spinner
eva-config-picker-customer --> picker-customer-logo
eva-config-picker-customer --> eva-config-picker-endpoint-status
eva-config-picker-endpoint-status --> eva-config-picker-spinner
style eva-config-picker fill:#f9f,stroke:#333,stroke-width:4px
Expand Down

0 comments on commit 834a2fb

Please sign in to comment.