-
-
- {`Version: ${version}`}
-
-
- {`Build: ${build}`}
-
-
- {'Dimensions: '}
- {`${document.documentElement.clientWidth} (${window.innerWidth})w `}
- {`${document.documentElement.clientHeight} (${window.innerHeight})h `}
-
-
- {`Pixel ratio: ${window.devicePixelRatio}`}
-
-
-
-
-
State
-
- {`Items: ${Object.keys(items).length}`}
-
-
- {`Coldstore items: ${this.state.localForageLength}`}
-
-
- {`Notifications: ${Object.keys(notifications).length}`}
-
-
- {`Processes: ${Object.keys(processes).length}`}
-
-
- {`Enqueue batches: ${enqueue_uris_batches.length}`}
-
-
- {`Cached URLs: ${Object.keys(getStorage('cache')).length}`}
-
-
-
-
-
Config
-
- {`Slim mode: ${slim_mode ? 'on' : 'off'}`}
-
-
- {`Test mode: ${test_mode ? 'on' : 'off'}`}
-
-
- {`Touch: ${isTouchDevice() ? 'on' : 'off'}`}
-
-
- {`LocalStorage usage: ${localStorageUsage.used}kb (~${localStorageUsage.percent}%)`}
-
-
- {`Selected tracks: ${selected_tracks.length}`}
-
- {
- selected_tracks.map((track_key, index) => (
-
{track_key}
- ))
- }
-
-
-
-
-
Load queue
- {this.renderLoadQueue()}
-
-
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const {
- core: {
- items,
- },
- ui: {
- notifications,
- processes,
- slim_mode,
- test_mode,
- selected_tracks,
- load_queue,
- },
- mopidy: {
- enqueue_uris_batches,
- },
- } = state;
-
return {
- items,
- notifications,
- processes,
- slim_mode,
- test_mode,
- selected_tracks,
- enqueue_uris_batches,
- load_queue,
+ used,
+ percent: (used / total * 100).toFixed(2),
};
};
-const mapDispatchToProps = (dispatch) => ({
- uiActions: bindActionCreators(uiActions, dispatch),
-});
+const LoadQueue = () => {
+ const { load_queue } = useSelector((state) => state.ui);
+
+ if (!load_queue) return
+
+
+ {`Version: ${version}`}
+
+
+ {`Build: ${build}`}
+
+
+ {'Dimensions: '}
+ {`${document.documentElement.clientWidth} (${window.innerWidth})w `}
+ {`${document.documentElement.clientHeight} (${window.innerHeight})h `}
+
+
+ {`Pixel ratio: ${window.devicePixelRatio}`}
+
+
+
+
+
State
+
+ {`Items: ${Object.keys(items).length}`}
+
+
+ {`Coldstore items: ${localForageLength}`}
+
+
+ {`Notifications: ${Object.keys(notifications).length}`}
+
+
+ {`Processes: ${Object.keys(processes).length}`}
+
+
+ {`Enqueue batches: ${enqueue_uris_batches.length}`}
+
+
+ {`Cached URLs: ${Object.keys(getStorage('cache')).length}`}
+
+
+
+
+
Config
+
+ {`Slim mode: ${slim_mode ? 'on' : 'off'}`}
+
+
+ {`Test mode: ${test_mode ? 'on' : 'off'}`}
+
+
+ {`Touch: ${isTouchDevice() ? 'on' : 'off'}`}
+
+
+ {`LocalStorage usage: ${localStorageUsage.used}kb (~${localStorageUsage.percent}%)`}
+
+
+ {`Selected tracks: ${selected_tracks.length}`}
+
+ {
+ selected_tracks.map((track_key, index) => (
+
{track_key}
+ ))
+ }
+
+
+
+
+
Load queue
+
+
+
+
+ );
+}
+
+export default DebugInfo;
diff --git a/src/js/components/SmartList.js b/src/js/components/SmartList.js
index caa09e95..9f0d842a 100644
--- a/src/js/components/SmartList.js
+++ b/src/js/components/SmartList.js
@@ -21,7 +21,8 @@ const SmartListBatch = handleViewport(
// Listen for changes to our height, and pass it up to our Grid. This is then used to build the
// placeholder elements when out of viewport. We only care about the first item because this
// represents the same heights for everything else (in almost all circumstances).
- const { current: { clientHeight } = {} } = forwardedRef;
+ const { current } = forwardedRef;
+ const { clientHeight } = current || {};
useEffect(() => {
if (isFirst && clientHeight !== itemHeight) {
setItemHeight(clientHeight);
diff --git a/src/js/components/Track.js b/src/js/components/Track.js
index 8d1207d8..4f2b1801 100755
--- a/src/js/components/Track.js
+++ b/src/js/components/Track.js
@@ -65,6 +65,7 @@ const Track = ({
getDragItem,
events,
}) => {
+ return null;
const index = getItemIndex();
const [{ isDragging }, drag] = useDrag({
type: 'TRACK',
diff --git a/src/js/store/index.js b/src/js/store/index.js
index 9a34591b..eb520b92 100755
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -230,9 +230,16 @@ const rootReducer = (state, action) => {
return appReducer(nextState, action);
};
-const store = createStore(
+const buildStore = (
+ {
+ initialState: customInitialState = {},
+ } = {},
+) => createStore(
rootReducer,
- initialState,
+ {
+ ...initialState,
+ ...customInitialState,
+ },
applyMiddleware(
thunk,
coreMiddleware,
@@ -245,7 +252,9 @@ const store = createStore(
snapcastMiddleware,
),
);
+
+const store = buildStore();
const persistor = persistStore(store);
-export default { store, persistor };
-export { store, persistor, initialState };
+export default { buildStore, store, persistor };
+export { buildStore, store, persistor, initialState };