mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-19 16:04:41 +00:00
feat: add disable save watch history setting
This commit is contained in:
parent
fd7638121c
commit
59419d4ad4
2 changed files with 22 additions and 1 deletions
|
@ -41,6 +41,7 @@ import HlsVideo from "hls-video-element/react";
|
|||
import VideoJS from "videojs-video-element/react";
|
||||
import { ENDPOINTS } from "#/api/config";
|
||||
import { saveAnonEpisodeWatched } from "./ReleasePlayer";
|
||||
import { usePreferencesStore } from "#/store/preferences";
|
||||
|
||||
export const ReleasePlayerCustom = (props: {
|
||||
id: number;
|
||||
|
@ -72,6 +73,8 @@ export const ReleasePlayerCustom = (props: {
|
|||
const [playbackRate, setPlaybackRate] = useState(1);
|
||||
const [isErrorDetailsOpen, setIsErrorDetailsOpen] = useState(false);
|
||||
|
||||
const preferenceStore = usePreferencesStore()
|
||||
|
||||
useEffect(() => {
|
||||
const __getInfo = async () => {
|
||||
if (source.selected.name == "Kodik") {
|
||||
|
@ -142,7 +145,7 @@ export const ReleasePlayerCustom = (props: {
|
|||
}, []);
|
||||
|
||||
function saveEpisodeToHistory() {
|
||||
if (episode.selected && !episode.selected.is_watched) {
|
||||
if (preferenceStore.flags.saveWatchHistory && episode.selected && !episode.selected.is_watched) {
|
||||
const objectToReplace = episode.available.find(
|
||||
(arrayItem: Episode) => arrayItem.position === episode.selected.position
|
||||
);
|
||||
|
|
|
@ -249,6 +249,24 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
|
|||
checked={preferenceStore.flags.showChangelog}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className=" dark:text-white">Сохранять историю просмотра</p>
|
||||
<p className="max-w-sm text-gray-500 dark:text-gray-300">
|
||||
При отключении, история не будет сохранятся как локально, так и
|
||||
на аккаунте
|
||||
</p>
|
||||
</div>
|
||||
<ToggleSwitch
|
||||
color="blue"
|
||||
onChange={() =>
|
||||
preferenceStore.setFlags({
|
||||
saveWatchHistory: !preferenceStore.flags.saveWatchHistory,
|
||||
})
|
||||
}
|
||||
checked={preferenceStore.flags.saveWatchHistory}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className=" dark:text-white">Отправка аналитики</p>
|
||||
|
|
Loading…
Add table
Reference in a new issue