@social-mail/social-mail-client 1.2.330 → 1.2.331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.330",
3
+ "version": "1.2.331",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -100,13 +100,11 @@ export default class StoreItemDetailView extends AtomControl {
100
100
  this.runAfterInit(() => this.app.runAsync(() => this.init()));
101
101
  }
102
102
 
103
- getFiles( ... items: IStoreItem[]) {
104
- const files = [];
105
- for (const iterator of items) {
106
- if(!iterator?.mediaFiles) {
107
- continue;
108
- }
109
- files.push(... iterator.mediaFiles);
103
+ getFiles(item: IStoreItem, varient: IStoreItem, size: IStoreItem) {
104
+ const varientFiles = varient?.mediaFiles?.filter((x) => x.isPreview);
105
+ const files = varientFiles ?? item.mediaFiles.filter((x) => x.isPreview);
106
+ if (size?.mediaFiles) {
107
+ files.push(... size.mediaFiles.filter((x) => x.isPreview));
110
108
  }
111
109
  this.selectedFile = files[0];
112
110
  return files;
@@ -139,7 +137,7 @@ export default class StoreItemDetailView extends AtomControl {
139
137
 
140
138
  this.renderer = <div
141
139
  class={css}
142
- images={Bind.oneWay(() => this.getFiles(this.model, this.selectedSize, this.selectedVarient))}>
140
+ images={Bind.oneWay(() => this.getFiles(this.model, this.selectedVarient, this.selectedSize))}>
143
141
  <h2>{this.model.name}</h2>
144
142
 
145
143
  <section class="photos">