feat: ability to disable list updated toast #38

This commit is contained in:
NoCrypt 2024-10-02 22:58:18 +07:00
parent 1b480fc939
commit 6048a0628d
4 changed files with 12 additions and 3 deletions

View file

@ -2,7 +2,7 @@ import { alToken, malToken, isAuthorized } from '@/modules/settings.js'
import { anilistClient, codes } from '@/modules/anilist.js'
import { malClient } from '@/modules/myanimelist.js'
import { malDubs } from "@/modules/animedubs.js"
import { profiles } from '@/modules/settings.js'
import { profiles, settings } from '@/modules/settings.js'
import { toast } from 'svelte-sonner'
import { get } from 'svelte/store'
import Fuse from 'fuse.js'
@ -295,6 +295,7 @@ export default class Helper {
if (res?.data?.mediaListEntry || res?.data?.SaveMediaListEntry) {
debug(`List Updated ${who}: ${description.replace(/\n/g, ', ')}`)
if (!profile) {
if(!get(settings).listUpdateToast) return;
toast.success('List Updated', {
description,
duration: 6000

View file

@ -199,7 +199,8 @@ export const defaults = {
swipeGestures: SUPPORTS.isAndroid,
volumeScroll: !SUPPORTS.isAndroid,
volumeScrollStep: 5,
playbackRateStep: 0.1
playbackRateStep: 0.1,
listUpdateToast: true
}
export const subtitleExtensions = ['srt', 'vtt', 'ass', 'ssa', 'sub', 'txt']

View file

@ -100,6 +100,12 @@
<label for='hide-my-anime'>{settings.hideMyAnime ? 'On' : 'Off'}</label>
</div>
</SettingCard>
<SettingCard title='Show List Updated Toast' description={'Some people might find the "List Updated" toast annoying. Disabling this will hide that toast, while still showing a toast if there\'s an error.'}>
<div class='custom-switch'>
<input type='checkbox' id='list-update-toast' bind:checked={settings.listUpdateToast} />
<label for='list-update-toast'>{settings.listUpdateToast ? 'On' : 'Off'}</label>
</div>
</SettingCard>
{/if}
<SettingCard title='RSS Feeds' description={'RSS feeds to display on the home screen. This needs to be a CORS enabled URL to a Nyaa or Tosho like RSS feed which cotains either an "infoHash" or "enclosure" tag.\nThis only shows the releases on the home screen, it doesn\'t automatically download the content.\nSince the feeds only provide the name of the file, Migu might not always detect the anime correctly!\nSome presets for popular groups are already provided as an example, custom feeds require the FULL URL.'}>
<div>

View file

@ -1,6 +1,6 @@
<script>
import { anilistClient, codes } from '@/modules/anilist.js'
import { profiles } from '@/modules/settings.js'
import { profiles, settings } from '@/modules/settings.js'
import { click } from '@/modules/click.js'
import { get, writable } from 'svelte/store'
import { toast } from 'svelte-sonner'
@ -148,6 +148,7 @@
debug(`List Updated${who}: ${description.replace(/\n/g, ', ')}`)
if (!profile) {
if (save) {
if(!get(settings).listUpdateToast) return;
toast.success('List Updated', {
description,
duration: 6000