Testing percentage indicator
This commit is contained in:
@ -39,12 +39,15 @@ export default class Notifications extends React.Component{
|
||||
}
|
||||
|
||||
renderProcess(process){
|
||||
|
||||
var progress = ((process.data.total - process.data.remaining) / process.data.total * 100).toFixed()
|
||||
|
||||
switch (process.status){
|
||||
case 'running':
|
||||
return(
|
||||
<div className="process notification" key={process.key}>
|
||||
<div className="loader"></div>
|
||||
{process.message}
|
||||
{process.message} {progress ? progress+'%' : null}
|
||||
<FontAwesome name="close" className="close-button" onClick={e => {this.props.uiActions.cancelProcess(process.key)}} />
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -503,6 +503,7 @@ const MopidyMiddleware = (function(){
|
||||
query: action.query,
|
||||
limit: action.limit,
|
||||
total: uri_schemes_total,
|
||||
remaining: uri_schemes.length,
|
||||
uri_scheme: uri_scheme,
|
||||
uri_schemes: uri_schemes
|
||||
}
|
||||
@ -524,16 +525,19 @@ const MopidyMiddleware = (function(){
|
||||
return
|
||||
}
|
||||
|
||||
// Update UI for this round
|
||||
store.dispatch(uiActions.updateProcess(
|
||||
'MOPIDY_GET_SEARCH_RESULTS_PROCESSOR',
|
||||
'Searching '+action.data.uri_scheme.replace(':','')
|
||||
))
|
||||
|
||||
// Construct our next batch's task
|
||||
var next_uri_schemes = Object.assign([], action.data.uri_schemes)
|
||||
var next_uri_scheme = next_uri_schemes.shift()
|
||||
|
||||
// Update UI for this round
|
||||
store.dispatch(uiActions.updateProcess(
|
||||
'MOPIDY_GET_SEARCH_RESULTS_PROCESSOR',
|
||||
'Searching '+action.data.uri_scheme.replace(':',''),
|
||||
{
|
||||
remaining: next_uri_schemes.length,
|
||||
}
|
||||
))
|
||||
|
||||
switch (action.data.context){
|
||||
|
||||
// Albums
|
||||
|
||||
@ -147,7 +147,6 @@ export default function reducer(mopidy = {}, action){
|
||||
**/
|
||||
|
||||
case 'MOPIDY_CLEAR_SEARCH_RESULTS':
|
||||
console.log(action)
|
||||
return Object.assign({}, mopidy, { search_results: {} });
|
||||
|
||||
case 'MOPIDY_SEARCH_RESULTS_LOADED':
|
||||
|
||||
Reference in New Issue
Block a user