Progress loading check for null, not 0
This commit is contained in:
@ -133374,13 +133374,14 @@ var makeProcessProgressSelector = function makeProcessProgressSelector(keys) {
|
|||||||
}).filter(function (i) {
|
}).filter(function (i) {
|
||||||
return i.status === 'running';
|
return i.status === 'running';
|
||||||
});
|
});
|
||||||
|
if (!selectedProcesses.length) return null;
|
||||||
var total = 0;
|
var total = 0;
|
||||||
var remaining = 0;
|
var remaining = 0;
|
||||||
selectedProcesses.forEach(function (process) {
|
selectedProcesses.forEach(function (process) {
|
||||||
if (process.total) total += process.total;
|
if (process.total) total += process.total;
|
||||||
if (process.remaining) remaining += process.remaining;
|
if (process.remaining) remaining += process.remaining;
|
||||||
});
|
});
|
||||||
return total && remaining ? ((total - remaining) / total).toFixed(4) : 1;
|
return total && remaining ? ((total - remaining) / total).toFixed(4) : 0;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -141335,7 +141336,7 @@ var LibraryAlbums = /*#__PURE__*/function (_React$Component) {
|
|||||||
filter = _this$state2.filter;
|
filter = _this$state2.filter;
|
||||||
var albums = _this.props.albums;
|
var albums = _this.props.albums;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_18__["default"], {
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_18__["default"], {
|
||||||
body: true,
|
body: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
@ -141416,7 +141417,7 @@ var LibraryAlbums = /*#__PURE__*/function (_React$Component) {
|
|||||||
var _this$state3 = _this.state,
|
var _this$state3 = _this.state,
|
||||||
filter = _this$state3.filter,
|
filter = _this$state3.filter,
|
||||||
per_page = _this$state3.per_page;
|
per_page = _this$state3.per_page;
|
||||||
var loading = loading_progress < 1;
|
var loading = loading_progress !== null;
|
||||||
var source_options = [{
|
var source_options = [{
|
||||||
value: 'all',
|
value: 'all',
|
||||||
label: Object(_locale__WEBPACK_IMPORTED_MODULE_17__["i18n"])('fields.filters.all')
|
label: Object(_locale__WEBPACK_IMPORTED_MODULE_17__["i18n"])('fields.filters.all')
|
||||||
@ -141840,7 +141841,7 @@ var LibraryArtists = /*#__PURE__*/function (_React$Component) {
|
|||||||
filter = _this$state.filter;
|
filter = _this$state.filter;
|
||||||
var artists = _this.props.artists;
|
var artists = _this.props.artists;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_15__["default"], {
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_15__["default"], {
|
||||||
body: true,
|
body: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
@ -141917,7 +141918,7 @@ var LibraryArtists = /*#__PURE__*/function (_React$Component) {
|
|||||||
spotify_available = _this$props6.spotify_available,
|
spotify_available = _this$props6.spotify_available,
|
||||||
google_available = _this$props6.google_available,
|
google_available = _this$props6.google_available,
|
||||||
loading_progress = _this$props6.loading_progress;
|
loading_progress = _this$props6.loading_progress;
|
||||||
var loading = loading_progress < 1;
|
var loading = loading_progress !== null;
|
||||||
var source_options = [{
|
var source_options = [{
|
||||||
value: 'all',
|
value: 'all',
|
||||||
label: Object(_locale__WEBPACK_IMPORTED_MODULE_13__["i18n"])('fields.filters.all')
|
label: Object(_locale__WEBPACK_IMPORTED_MODULE_13__["i18n"])('fields.filters.all')
|
||||||
@ -142957,7 +142958,7 @@ var LibraryPlaylists = /*#__PURE__*/function (_React$Component) {
|
|||||||
filter = _this$state.filter,
|
filter = _this$state.filter,
|
||||||
limit = _this$state.limit;
|
limit = _this$state.limit;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_17__["default"], {
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_17__["default"], {
|
||||||
body: true,
|
body: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
@ -143043,7 +143044,7 @@ var LibraryPlaylists = /*#__PURE__*/function (_React$Component) {
|
|||||||
view = _this$props4.view,
|
view = _this$props4.view,
|
||||||
loading_progress = _this$props4.loading_progress;
|
loading_progress = _this$props4.loading_progress;
|
||||||
var filter = _this.state.filter;
|
var filter = _this.state.filter;
|
||||||
var loading = loading_progress < 1;
|
var loading = loading_progress !== null;
|
||||||
var source_options = [{
|
var source_options = [{
|
||||||
value: 'all',
|
value: 'all',
|
||||||
label: Object(_locale__WEBPACK_IMPORTED_MODULE_16__["i18n"])('fields.filters.all')
|
label: Object(_locale__WEBPACK_IMPORTED_MODULE_16__["i18n"])('fields.filters.all')
|
||||||
@ -143509,7 +143510,7 @@ var LibraryTracks = /*#__PURE__*/function (_React$Component) {
|
|||||||
filter = _this$state2.filter;
|
filter = _this$state2.filter;
|
||||||
var tracks = _this.props.tracks;
|
var tracks = _this.props.tracks;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_16__["default"], {
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Loader__WEBPACK_IMPORTED_MODULE_16__["default"], {
|
||||||
body: true,
|
body: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
@ -143558,7 +143559,7 @@ var LibraryTracks = /*#__PURE__*/function (_React$Component) {
|
|||||||
var _this$state3 = _this.state,
|
var _this$state3 = _this.state,
|
||||||
filter = _this$state3.filter,
|
filter = _this$state3.filter,
|
||||||
per_page = _this$state3.per_page;
|
per_page = _this$state3.per_page;
|
||||||
var loading = loading_progress < 1;
|
var loading = loading_progress !== null;
|
||||||
var source_options = [{
|
var source_options = [{
|
||||||
value: 'all',
|
value: 'all',
|
||||||
label: Object(_locale__WEBPACK_IMPORTED_MODULE_15__["i18n"])('fields.filters.all')
|
label: Object(_locale__WEBPACK_IMPORTED_MODULE_15__["i18n"])('fields.filters.all')
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
4
mopidy_iris/static/app.min.js
vendored
4
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
// Release details
|
// Release details
|
||||||
// These are automatically injected to built HTML
|
// These are automatically injected to built HTML
|
||||||
var build = "1603447492";
|
var build = "1603492267";
|
||||||
var version = "3.53.0";
|
var version = "3.53.0";
|
||||||
|
|
||||||
// Construct the script tag
|
// Construct the script tag
|
||||||
|
|||||||
@ -60,13 +60,15 @@ const makeProcessProgressSelector = (keys) => createSelector(
|
|||||||
.map((key) => processes[key] || {})
|
.map((key) => processes[key] || {})
|
||||||
.filter((i) => i.status === 'running');
|
.filter((i) => i.status === 'running');
|
||||||
|
|
||||||
|
if (!selectedProcesses.length) return null;
|
||||||
|
|
||||||
let total = 0;
|
let total = 0;
|
||||||
let remaining = 0;
|
let remaining = 0;
|
||||||
selectedProcesses.forEach((process) => {
|
selectedProcesses.forEach((process) => {
|
||||||
if (process.total) total += process.total;
|
if (process.total) total += process.total;
|
||||||
if (process.remaining) remaining += process.remaining;
|
if (process.remaining) remaining += process.remaining;
|
||||||
});
|
});
|
||||||
return total && remaining ? ((total - remaining) / total).toFixed(4) : 1;
|
return total && remaining ? ((total - remaining) / total).toFixed(4) : 0;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -195,7 +195,7 @@ class LibraryAlbums extends React.Component {
|
|||||||
} = this.state;
|
} = this.state;
|
||||||
let { albums } = this.props;
|
let { albums } = this.props;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return <Loader body loading progress={loading_progress} />;
|
return <Loader body loading progress={loading_progress} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ class LibraryAlbums extends React.Component {
|
|||||||
filter,
|
filter,
|
||||||
per_page,
|
per_page,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const loading = loading_progress < 1;
|
const loading = loading_progress !== null;
|
||||||
|
|
||||||
const source_options = [
|
const source_options = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import Button from '../../components/Button';
|
|||||||
import Loader from '../../components/Loader';
|
import Loader from '../../components/Loader';
|
||||||
import {
|
import {
|
||||||
makeLibrarySelector,
|
makeLibrarySelector,
|
||||||
makeLoadingSelector,
|
|
||||||
makeProcessProgressSelector,
|
makeProcessProgressSelector,
|
||||||
} from '../../util/selectors';
|
} from '../../util/selectors';
|
||||||
|
|
||||||
@ -172,8 +171,8 @@ class LibraryArtists extends React.Component {
|
|||||||
} = this.state;
|
} = this.state;
|
||||||
let { artists } = this.props;
|
let { artists } = this.props;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return <Loader body loading progress={loading_progress} />
|
return <Loader body loading progress={loading_progress} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sort) {
|
if (sort) {
|
||||||
@ -229,7 +228,7 @@ class LibraryArtists extends React.Component {
|
|||||||
google_available,
|
google_available,
|
||||||
loading_progress,
|
loading_progress,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const loading = loading_progress < 1;
|
const loading = loading_progress !== null;
|
||||||
|
|
||||||
const source_options = [
|
const source_options = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -159,7 +159,7 @@ class LibraryPlaylists extends React.Component {
|
|||||||
limit,
|
limit,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return <Loader body loading progress={loading_progress} />;
|
return <Loader body loading progress={loading_progress} />;
|
||||||
}
|
}
|
||||||
let playlists = [...playlistsProp];
|
let playlists = [...playlistsProp];
|
||||||
@ -225,7 +225,7 @@ class LibraryPlaylists extends React.Component {
|
|||||||
const {
|
const {
|
||||||
filter,
|
filter,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const loading = loading_progress < 1;
|
const loading = loading_progress !== null;
|
||||||
|
|
||||||
const source_options = [
|
const source_options = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -173,7 +173,7 @@ class LibraryTracks extends React.Component {
|
|||||||
} = this.state;
|
} = this.state;
|
||||||
let { tracks } = this.props;
|
let { tracks } = this.props;
|
||||||
|
|
||||||
if (loading_progress < 1) {
|
if (loading_progress !== null) {
|
||||||
return <Loader body loading progress={loading_progress} />;
|
return <Loader body loading progress={loading_progress} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ class LibraryTracks extends React.Component {
|
|||||||
filter,
|
filter,
|
||||||
per_page,
|
per_page,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const loading = loading_progress < 1;
|
const loading = loading_progress !== null;
|
||||||
|
|
||||||
const source_options = [
|
const source_options = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user