Skip to content

Commit

Permalink
feat: ability to disable list updated toast #38
Browse files Browse the repository at this point in the history
  • Loading branch information
NoCrypt committed Oct 2, 2024
1 parent 1b480fc commit 6048a06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion common/modules/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion common/modules/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
6 changes: 6 additions & 0 deletions common/views/Settings/InterfaceSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 2 additions & 1 deletion common/views/ViewAnime/Scoring.svelte
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6048a06

Please sign in to comment.