Resetting everything, then restoringg essentials, fixes #734; Buildout ago
This commit is contained in:
@ -182332,6 +182332,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../util/helpers */ "./src/js/util/helpers.js");
|
||||
/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../locale */ "./src/js/locale/index.js");
|
||||
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../components/Button */ "./src/js/components/Button.js");
|
||||
/* harmony import */ var _components_Dater__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../components/Dater */ "./src/js/components/Dater.js");
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
@ -182379,6 +182380,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var CheckboxSetting = function CheckboxSetting(_ref) {
|
||||
@ -183090,10 +183092,14 @@ var Settings = /*#__PURE__*/function (_React$Component) {
|
||||
"data-qa-node": "a",
|
||||
"data-qa-file": "Settings"
|
||||
}, pusher.version.current), ' ', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
|
||||
className: "mid_grey-text",
|
||||
className: "mid_grey-text tooltip",
|
||||
"data-qa-node": "span",
|
||||
"data-qa-file": "Settings"
|
||||
}, build), pusher.version.upgrade_available ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
}, build, build && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
|
||||
className: "tooltip__content",
|
||||
"data-qa-node": "span",
|
||||
"data-qa-file": "Settings"
|
||||
}, Object(_components_Dater__WEBPACK_IMPORTED_MODULE_24__["dater"])('ago', parseInt(build, 10) * 1000), " ago")), pusher.version.upgrade_available ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
target: "_blank",
|
||||
rel: "noopener noreferrer",
|
||||
className: "flag flag--dark",
|
||||
@ -183339,6 +183345,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../components/Button */ "./src/js/components/Button.js");
|
||||
/* harmony import */ var _util_selectors__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../util/selectors */ "./src/js/util/selectors.js");
|
||||
/* harmony import */ var _util_format__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../util/format */ "./src/js/util/format.js");
|
||||
/* harmony import */ var _components_URILink__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../components/URILink */ "./src/js/components/URILink.js");
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
@ -183387,6 +183394,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var LyricsSelector = function LyricsSelector(_ref) {
|
||||
@ -183631,6 +183639,8 @@ var Track = /*#__PURE__*/function (_React$Component) {
|
||||
});
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
||||
var _track$album;
|
||||
|
||||
var _this$props4 = _this.props,
|
||||
uri = _this$props4.uri,
|
||||
track = _this$props4.track,
|
||||
@ -183696,9 +183706,10 @@ var Track = /*#__PURE__*/function (_React$Component) {
|
||||
}, track.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h2", {
|
||||
"data-qa-node": "h2",
|
||||
"data-qa-file": "Track"
|
||||
}, track.album && track.album.uri && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||
to: "/album/".concat(track.album.uri),
|
||||
"data-qa-node": "Link",
|
||||
}, (track === null || track === void 0 ? void 0 : (_track$album = track.album) === null || _track$album === void 0 ? void 0 : _track$album.uri) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_URILink__WEBPACK_IMPORTED_MODULE_25__["default"], {
|
||||
uri: track.album.uri,
|
||||
type: "album",
|
||||
"data-qa-node": "URILink",
|
||||
"data-qa-file": "Track"
|
||||
}, track.album.name), track.album && !track.album.uri ? track.album.name : null, !track.album && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_locale__WEBPACK_IMPORTED_MODULE_21__["I18n"], {
|
||||
path: "track.unknown_album",
|
||||
@ -192032,17 +192043,20 @@ var Reset = /*#__PURE__*/function (_React$Component) {
|
||||
|
||||
if (database) {
|
||||
tasks.push(new Promise(function (resolve) {
|
||||
localforage__WEBPACK_IMPORTED_MODULE_3___default.a.keys().then(function (keys) {
|
||||
var keysToRemove = keys.filter(function (key) {
|
||||
return !stateKeys.includes(key.replace('persist:', ''));
|
||||
// Fetch all our core keys and store them in memory while we wipe the whole database,
|
||||
// then we restore them back. This is much faster than checking keys and deleting items
|
||||
// one-by-one
|
||||
Promise.all(stateKeys.map(function (key) {
|
||||
return localforage__WEBPACK_IMPORTED_MODULE_3___default.a.getItem("persist:".concat(key));
|
||||
})).then(function (items) {
|
||||
localforage__WEBPACK_IMPORTED_MODULE_3___default.a.clear().then(function () {
|
||||
console.debug({
|
||||
items: items
|
||||
});
|
||||
keysToRemove.forEach(function (key, index) {
|
||||
localforage__WEBPACK_IMPORTED_MODULE_3___default.a.removeItem(key).then(function () {
|
||||
console.debug("Removed ".concat(key));
|
||||
|
||||
if (index === keysToRemove.length - 1) {
|
||||
resolve();
|
||||
}
|
||||
Promise.all(items.map(function (item, index) {
|
||||
return localforage__WEBPACK_IMPORTED_MODULE_3___default.a.setItem("persist:".concat(stateKeys[index]), item);
|
||||
})).then(function () {
|
||||
return resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
16
mopidy_iris/static/app.min.js
vendored
16
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -115,7 +115,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1621150096";
|
||||
var build = "1621152560";
|
||||
var version = "3.58.0";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -22,6 +22,7 @@ import * as spotifyActions from '../services/spotify/actions';
|
||||
import { isHosted } from '../util/helpers';
|
||||
import { i18n, I18n, languagesAvailable } from '../locale';
|
||||
import Button from '../components/Button';
|
||||
import { dater } from '../components/Dater';
|
||||
|
||||
const CheckboxSetting = ({
|
||||
name,
|
||||
@ -461,8 +462,13 @@ class Settings extends React.Component {
|
||||
{pusher.version.current}
|
||||
</a>
|
||||
{' '}
|
||||
<span className="mid_grey-text">
|
||||
<span className="mid_grey-text tooltip">
|
||||
{build}
|
||||
{build && (
|
||||
<span className="tooltip__content">
|
||||
{dater('ago', parseInt(build, 10) * 1000)} ago
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{pusher.version.upgrade_available ? (
|
||||
<a
|
||||
|
||||
@ -22,7 +22,8 @@ import { sourceIcon } from '../util/helpers';
|
||||
import { i18n, I18n } from '../locale';
|
||||
import Button from '../components/Button';
|
||||
import { makeLoadingSelector, makeItemSelector } from '../util/selectors';
|
||||
import { decodeUri } from '../util/format';
|
||||
import { decodeUri, encodeUri } from '../util/format';
|
||||
import URILink from '../components/URILink';
|
||||
|
||||
const LyricsSelector = ({
|
||||
track: {
|
||||
@ -258,7 +259,7 @@ class Track extends React.Component {
|
||||
|
||||
<h1>{track.name}</h1>
|
||||
<h2>
|
||||
{track.album && track.album.uri && <Link to={`/album/${track.album.uri}`}>{track.album.name}</Link>}
|
||||
{track?.album?.uri && <URILink uri={track.album.uri} type="album">{track.album.name}</URILink>}
|
||||
{track.album && !track.album.uri ? track.album.name : null}
|
||||
{!track.album && <I18n path="track.unknown_album" />}
|
||||
<I18n path="common.by" />
|
||||
|
||||
@ -72,19 +72,27 @@ class Reset extends React.Component {
|
||||
if (database) {
|
||||
tasks.push(
|
||||
new Promise((resolve) => {
|
||||
localForage.keys().then((keys) => {
|
||||
const keysToRemove = keys.filter(
|
||||
(key) => !stateKeys.includes(key.replace('persist:', '')),
|
||||
// Fetch all our core keys and store them in memory while we wipe the whole database,
|
||||
// then we restore them back. This is much faster than checking keys and deleting items
|
||||
// one-by-one
|
||||
Promise.all(
|
||||
stateKeys.map((key) => localForage.getItem(`persist:${key}`)),
|
||||
).then(
|
||||
(items) => {
|
||||
localForage.clear().then(
|
||||
() => {
|
||||
console.debug({ items });
|
||||
Promise.all(
|
||||
items.map(
|
||||
(item, index) => localForage.setItem(`persist:${stateKeys[index]}`, item),
|
||||
),
|
||||
).then(
|
||||
() => resolve(),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
keysToRemove.forEach((key, index) => {
|
||||
localForage.removeItem(key).then(() => {
|
||||
console.debug(`Removed ${key}`);
|
||||
if (index === keysToRemove.length - 1) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user