Skip to content

Commit

Permalink
fix: wrong import of store
Browse files Browse the repository at this point in the history
  • Loading branch information
puemos committed Apr 16, 2024
1 parent 56cb9a2 commit 5c415bc
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/background/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStore } from "@hls-downloader/core/lib/store";
import { createStore } from "@hls-downloader/core/lib/store/configure-store";
import { wrapStore } from "webext-redux";
import { subscribeListeners } from "./listeners";
import { getState, saveState } from "./persistState";
Expand Down
2 changes: 1 addition & 1 deletion src/background/src/persistState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { storage } from "webextension-polyfill";
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";

export async function saveState(state: RootState) {
if (!state) {
Expand Down
4 changes: 2 additions & 2 deletions src/popup/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/popup/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Provider } from "react-redux";
import { Store } from "webext-redux";
import App from "./App";

import { Store as IStore } from "@hls-downloader/core/lib/store";
import { Store as IStore } from "@hls-downloader/core/lib/store/configure-store";

import "./index.css";

Expand All @@ -20,6 +20,6 @@ import "./index.css";
<React.StrictMode>
<App />
</React.StrictMode>
</Provider>,
</Provider>
);
})();
2 changes: 1 addition & 1 deletion src/popup/src/modules/Downloads/DownloadsController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Job } from "@hls-downloader/core/lib/entities";
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";
import { useState } from "react";
import { useSelector } from "react-redux";

Expand Down
2 changes: 1 addition & 1 deletion src/popup/src/modules/Job/JobController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Job, JobStatus } from "@hls-downloader/core/lib/entities";
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";
import { jobsSlice } from "@hls-downloader/core/lib/store/slices";
import { useDispatch, useSelector } from "react-redux";

Expand Down
4 changes: 2 additions & 2 deletions src/popup/src/modules/Playlist/PlaylistController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Level, PlaylistStatus } from "@hls-downloader/core/lib/entities";
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";
import { levelsSlice } from "@hls-downloader/core/lib/store/slices";
import { useContext } from "react";
import { useDispatch, useSelector } from "react-redux";
Expand All @@ -18,7 +18,7 @@ const usePlaylistController = ({ id }: { id: string }): ReturnType => {
const dispatch = useDispatch();

const status = useSelector<RootState, PlaylistStatus | null>(
(state) => state.playlists.playlistsStatus[id],
(state) => state.playlists.playlistsStatus[id]
);
const levels = useSelector<RootState, Level[]>((state) => {
const list = Object.values(state.levels.levels)
Expand Down
18 changes: 9 additions & 9 deletions src/popup/src/modules/Settings/SettingsController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";
import { configSlice } from "@hls-downloader/core/lib/store/slices";
import { useDispatch, useSelector } from "react-redux";

Expand All @@ -16,48 +16,48 @@ interface ReturnType {
const useSettingsController = (): ReturnType => {
const dispatch = useDispatch();
const concurrency = useSelector<RootState, number>(
(state) => state.config.concurrency,
(state) => state.config.concurrency
);
const fetchAttempts = useSelector<RootState, number>(
(state) => state.config.fetchAttempts,
(state) => state.config.fetchAttempts
);
const saveDialog = useSelector<RootState, boolean>(
(state) => state.config.saveDialog,
(state) => state.config.saveDialog
);

function onConcurrencyIncrease() {
dispatch(
configSlice.actions.setConcurrency({
concurrency: concurrency + 1,
}),
})
);
}
function onConcurrencyDecrease() {
dispatch(
configSlice.actions.setConcurrency({
concurrency: Math.max(1, concurrency - 1),
}),
})
);
}
function onFetchAttemptsIncrease() {
dispatch(
configSlice.actions.setFetchAttempts({
fetchAttempts: fetchAttempts + 1,
}),
})
);
}
function onFetchAttemptsDecrease() {
dispatch(
configSlice.actions.setFetchAttempts({
fetchAttempts: Math.max(1, fetchAttempts - 1),
}),
})
);
}
function onSaveDialogToggle() {
dispatch(
configSlice.actions.setSaveDialog({
saveDialog: !saveDialog,
}),
})
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/popup/src/modules/Sniffer/SnifferController.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Playlist, PlaylistStatus } from "@hls-downloader/core/lib/entities";
import { RootState } from "@hls-downloader/core/lib/store";
import { RootState } from "@hls-downloader/core/lib/store/root-reducer";
import {
levelsSlice,
playlistsSlice
playlistsSlice,
} from "@hls-downloader/core/lib/store/slices";
import { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
Expand Down

0 comments on commit 5c415bc

Please sign in to comment.