comparison src/app/app.component.ts @ 466:8820a133bcf5

Don't save progress changes etc to the state history.
author Lucas Thompson <dev@lucas.im>
date Fri, 30 Jun 2017 14:50:00 +0100
parents 50f61d1945db
children c9f12a9c1d5c
comparison
equal deleted inserted replaced
465:caef9a302bec 466:8820a133bcf5
91 const index = this.analyses.findIndex(val => val.id === progress.id); 91 const index = this.analyses.findIndex(val => val.id === progress.id);
92 if (index === -1) { 92 if (index === -1) {
93 return; 93 return;
94 } 94 }
95 95
96 this.analyses.set( 96 this.analyses.setMutating(
97 index, 97 index,
98 Object.assign( 98 Object.assign(
99 {}, 99 {},
100 this.analyses.get(index), 100 this.analyses.get(index),
101 {progress: progress.value} 101 {progress: progress.value}
130 isExportable: createExportableItem 130 isExportable: createExportableItem
131 } as RootAudioItem; 131 } as RootAudioItem;
132 132
133 // TODO re-ordering of items for display 133 // TODO re-ordering of items for display
134 // , one alternative is a Angular Pipe / Filter for use in the Template 134 // , one alternative is a Angular Pipe / Filter for use in the Template
135 this.analyses.unshift(pending); 135 this.analyses.unshiftMutating(pending);
136 } 136 }
137 137
138 extractFeatures(outputInfo: ExtractorOutputInfo): string { 138 extractFeatures(outputInfo: ExtractorOutputInfo): string {
139 if (!this.canExtract || !outputInfo) { 139 if (!this.canExtract || !outputInfo) {
140 return; 140 return;
153 title: outputInfo.name, 153 title: outputInfo.name,
154 description: outputInfo.outputId, 154 description: outputInfo.outputId,
155 id: `${++this.countingId}`, 155 id: `${++this.countingId}`,
156 progress: 0 156 progress: 0
157 }; 157 };
158 this.analyses.unshift(placeholderCard); 158 this.analyses.unshiftMutating(placeholderCard);
159 this.sendExtractionRequest(placeholderCard); 159 this.sendExtractionRequest(placeholderCard);
160 return placeholderCard.id; 160 return placeholderCard.id;
161 } 161 }
162 throw new Error('Cannot extract. No audio loaded'); 162 throw new Error('Cannot extract. No audio loaded');
163 } 163 }