changed flowbite button to standard button
This commit is contained in:
		@@ -23,14 +23,9 @@
 | 
			
		||||
  } from "../mal/types/MALTypes";
 | 
			
		||||
  import type { SimklAnime } from "../simkl/types/simklTypes";
 | 
			
		||||
  import { writable } from "svelte/store";
 | 
			
		||||
    import type {
 | 
			
		||||
        StatusOption,
 | 
			
		||||
        StatusOptions,
 | 
			
		||||
    } from "../helperTypes/StatusTypes";
 | 
			
		||||
  import type { StatusOption, StatusOptions } from "../helperTypes/StatusTypes";
 | 
			
		||||
  import type { AniListUpdateVariables } from "../anilist/types/AniListTypes";
 | 
			
		||||
    import {
 | 
			
		||||
        convertDateToAniList,
 | 
			
		||||
    } from "../helperFunctions/convertDateToAniList";
 | 
			
		||||
  import { convertDateToAniList } from "../helperFunctions/convertDateToAniList";
 | 
			
		||||
  import {
 | 
			
		||||
    AniListDeleteEntry,
 | 
			
		||||
    AniListUpdateEntry,
 | 
			
		||||
@@ -82,8 +77,7 @@
 | 
			
		||||
    { id: 5, aniList: "REPEATING", mal: "rewatching", simkl: "watching" },
 | 
			
		||||
  ];
 | 
			
		||||
  let startingAnilistStatusOption: StatusOption = statusOptions.filter(
 | 
			
		||||
        (option) =>
 | 
			
		||||
            currentAniListAnime.data.MediaList.status === option.aniList,
 | 
			
		||||
    (option) => currentAniListAnime.data.MediaList.status === option.aniList,
 | 
			
		||||
  )[0];
 | 
			
		||||
  let startedAtDate: Date | null = convertAniListDateToDate(
 | 
			
		||||
    currentAniListAnime.data.MediaList.startedAt,
 | 
			
		||||
@@ -114,15 +108,11 @@
 | 
			
		||||
    let startDate = "";
 | 
			
		||||
    let finishDate = "";
 | 
			
		||||
    if (currentMalAnime.my_list_status.start_date !== "") {
 | 
			
		||||
            const startArray = re.exec(
 | 
			
		||||
                currentMalAnime.my_list_status.start_date,
 | 
			
		||||
            );
 | 
			
		||||
      const startArray = re.exec(currentMalAnime.my_list_status.start_date);
 | 
			
		||||
      startDate = `${startArray[2]}-${startArray[3]}-${startArray[1]}`;
 | 
			
		||||
    }
 | 
			
		||||
    if (currentMalAnime.my_list_status.finish_date !== "") {
 | 
			
		||||
            const finishArray = re.exec(
 | 
			
		||||
                currentMalAnime.my_list_status.finish_date,
 | 
			
		||||
            );
 | 
			
		||||
      const finishArray = re.exec(currentMalAnime.my_list_status.finish_date);
 | 
			
		||||
      finishDate = `${finishArray[2]}-${finishArray[3]}-${finishArray[1]}`;
 | 
			
		||||
    }
 | 
			
		||||
    AddAnimeServiceToTable({
 | 
			
		||||
@@ -199,10 +189,7 @@
 | 
			
		||||
      submitData[key] = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        if (
 | 
			
		||||
            isAniListLoggedIn &&
 | 
			
		||||
            currentAniListAnime.data.MediaList.mediaId !== 0
 | 
			
		||||
        ) {
 | 
			
		||||
    if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) {
 | 
			
		||||
      let body: AniListUpdateVariables = {
 | 
			
		||||
        mediaId: currentAniListAnime.data.MediaList.mediaId,
 | 
			
		||||
        progress: submitData.episodes,
 | 
			
		||||
@@ -213,8 +200,7 @@
 | 
			
		||||
        startedAt: convertDateToAniList(startedAtDate),
 | 
			
		||||
        completedAt: convertDateToAniList(completedAtDate),
 | 
			
		||||
      };
 | 
			
		||||
            await AniListUpdateEntry(body).then(
 | 
			
		||||
                (value: AniListGetSingleAnime) => {
 | 
			
		||||
      await AniListUpdateEntry(body).then((value: AniListGetSingleAnime) => {
 | 
			
		||||
        /* TODO in future when you inevitably add tags to typescript, until Anilist fixes the api bug
 | 
			
		||||
                    where tags break the SaveMediaListEntry return, you'll want to use this delete line
 | 
			
		||||
                    delete value.data.MediaList.media.tags */
 | 
			
		||||
@@ -238,8 +224,7 @@
 | 
			
		||||
          repeat: currentAniListAnime.data.MediaList.repeat,
 | 
			
		||||
          notes: currentAniListAnime.data.MediaList.notes,
 | 
			
		||||
        });
 | 
			
		||||
                },
 | 
			
		||||
            );
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (malLoggedIn && currentMalAnime.id !== 0) {
 | 
			
		||||
@@ -256,8 +241,7 @@
 | 
			
		||||
        (malAnimeReturn: MalListStatus) => {
 | 
			
		||||
          malAnime.update((value) => {
 | 
			
		||||
            value.my_list_status.status = malAnimeReturn.status;
 | 
			
		||||
                        value.my_list_status.is_rewatching =
 | 
			
		||||
                            malAnimeReturn.is_rewatching;
 | 
			
		||||
            value.my_list_status.is_rewatching = malAnimeReturn.is_rewatching;
 | 
			
		||||
            value.my_list_status.score = malAnimeReturn.score;
 | 
			
		||||
            value.my_list_status.num_episodes_watched =
 | 
			
		||||
              malAnimeReturn.num_episodes_watched;
 | 
			
		||||
@@ -284,14 +268,12 @@
 | 
			
		||||
            id: `m-${currentMalAnime.id}`,
 | 
			
		||||
            title: currentMalAnime.title,
 | 
			
		||||
            service: "MyAnimeList",
 | 
			
		||||
                        progress:
 | 
			
		||||
                            currentMalAnime.my_list_status.num_episodes_watched,
 | 
			
		||||
            progress: currentMalAnime.my_list_status.num_episodes_watched,
 | 
			
		||||
            status: currentMalAnime.my_list_status.status,
 | 
			
		||||
            startedAt: startDate,
 | 
			
		||||
            completedAt: finishDate,
 | 
			
		||||
            score: currentMalAnime.my_list_status.score,
 | 
			
		||||
                        repeat: currentMalAnime.my_list_status
 | 
			
		||||
                            .num_times_rewatched,
 | 
			
		||||
            repeat: currentMalAnime.my_list_status.num_times_rewatched,
 | 
			
		||||
            notes: currentMalAnime.my_list_status.comments,
 | 
			
		||||
          });
 | 
			
		||||
        },
 | 
			
		||||
@@ -299,13 +281,9 @@
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
 | 
			
		||||
            if (
 | 
			
		||||
                currentSimklAnime.watched_episodes_count !== submitData.episodes
 | 
			
		||||
            ) {
 | 
			
		||||
                await SimklSyncEpisodes(
 | 
			
		||||
                    currentSimklAnime,
 | 
			
		||||
                    submitData.episodes,
 | 
			
		||||
                ).then((value: SimklAnime) => {
 | 
			
		||||
      if (currentSimklAnime.watched_episodes_count !== submitData.episodes) {
 | 
			
		||||
        await SimklSyncEpisodes(currentSimklAnime, submitData.episodes).then(
 | 
			
		||||
          (value: SimklAnime) => {
 | 
			
		||||
            AddAnimeServiceToTable({
 | 
			
		||||
              id: `s-${value.show.ids.simkl}`,
 | 
			
		||||
              title: value.show.title,
 | 
			
		||||
@@ -322,14 +300,13 @@
 | 
			
		||||
              newValue = value;
 | 
			
		||||
              return newValue;
 | 
			
		||||
            });
 | 
			
		||||
                });
 | 
			
		||||
          },
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (currentSimklAnime.user_rating !== submitData.rating) {
 | 
			
		||||
                await SimklSyncRating(
 | 
			
		||||
                    currentSimklAnime,
 | 
			
		||||
                    submitData.rating,
 | 
			
		||||
                ).then((value) => {
 | 
			
		||||
        await SimklSyncRating(currentSimklAnime, submitData.rating).then(
 | 
			
		||||
          (value) => {
 | 
			
		||||
            AddAnimeServiceToTable({
 | 
			
		||||
              id: `s-${value.show.ids.simkl}`,
 | 
			
		||||
              title: value.show.title,
 | 
			
		||||
@@ -346,14 +323,13 @@
 | 
			
		||||
              newValue = value;
 | 
			
		||||
              return newValue;
 | 
			
		||||
            });
 | 
			
		||||
                });
 | 
			
		||||
          },
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (currentSimklAnime.status !== submitData.status.simkl) {
 | 
			
		||||
                await SimklSyncStatus(
 | 
			
		||||
                    currentSimklAnime,
 | 
			
		||||
                    submitData.status.simkl,
 | 
			
		||||
                ).then((value) => {
 | 
			
		||||
        await SimklSyncStatus(currentSimklAnime, submitData.status.simkl).then(
 | 
			
		||||
          (value) => {
 | 
			
		||||
            AddAnimeServiceToTable({
 | 
			
		||||
              id: `s-${value.show.ids.simkl}`,
 | 
			
		||||
              title: value.show.title,
 | 
			
		||||
@@ -370,7 +346,8 @@
 | 
			
		||||
              newValue = value;
 | 
			
		||||
              return newValue;
 | 
			
		||||
            });
 | 
			
		||||
                });
 | 
			
		||||
          },
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -381,10 +358,7 @@
 | 
			
		||||
 | 
			
		||||
  const deleteEntries = async () => {
 | 
			
		||||
    submitting.set(true);
 | 
			
		||||
        if (
 | 
			
		||||
            isAniListLoggedIn &&
 | 
			
		||||
            currentAniListAnime.data.MediaList.mediaId !== 0
 | 
			
		||||
        ) {
 | 
			
		||||
    if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) {
 | 
			
		||||
      await AniListDeleteEntry(currentAniListAnime.data.MediaList.id);
 | 
			
		||||
      AddAnimeServiceToTable({
 | 
			
		||||
        id: `a-${currentAniListAnime.data.MediaList.mediaId}`,
 | 
			
		||||
@@ -444,8 +418,7 @@
 | 
			
		||||
    currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode !== 0
 | 
			
		||||
  ) {
 | 
			
		||||
    max =
 | 
			
		||||
            currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode -
 | 
			
		||||
            1;
 | 
			
		||||
      currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode - 1;
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@@ -506,22 +479,18 @@
 | 
			
		||||
              id="episodes"
 | 
			
		||||
              class="border border-x-0 p-2.5 h-11 text-center text-sm block w-full placeholder-gray-400 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none
 | 
			
		||||
                            {currentAniListAnime.data.MediaList.progress < 0 ||
 | 
			
		||||
                            (currentAniListAnime.data.MediaList.media.episodes >
 | 
			
		||||
                                0 &&
 | 
			
		||||
              (currentAniListAnime.data.MediaList.media.episodes > 0 &&
 | 
			
		||||
                currentAniListAnime.data.MediaList.progress >
 | 
			
		||||
                                    currentAniListAnime.data.MediaList.media
 | 
			
		||||
                                        .episodes) ||
 | 
			
		||||
                            (currentAniListAnime.data.MediaList.media
 | 
			
		||||
                                .nextAiringEpisode.episode > 0 &&
 | 
			
		||||
                  currentAniListAnime.data.MediaList.media.episodes) ||
 | 
			
		||||
              (currentAniListAnime.data.MediaList.media.nextAiringEpisode
 | 
			
		||||
                .episode > 0 &&
 | 
			
		||||
                currentAniListAnime.data.MediaList.progress >
 | 
			
		||||
                                    currentAniListAnime.data.MediaList.media
 | 
			
		||||
                                        .nextAiringEpisode.episode -
 | 
			
		||||
                  currentAniListAnime.data.MediaList.media.nextAiringEpisode
 | 
			
		||||
                    .episode -
 | 
			
		||||
                    1)
 | 
			
		||||
                ? 'border-red-500 border-[2px] text-rose-300 focus:ring-red-500 focus:border-red-500'
 | 
			
		||||
                : 'bg-gray-700 hover:bg-gray-600 border-gray-600 text-white focus:ring-blue-500 focus:border-blue-500'} w-24"
 | 
			
		||||
                            bind:value={
 | 
			
		||||
                                currentAniListAnime.data.MediaList.progress
 | 
			
		||||
                            }
 | 
			
		||||
              bind:value={currentAniListAnime.data.MediaList.progress}
 | 
			
		||||
              required
 | 
			
		||||
            />
 | 
			
		||||
            <button
 | 
			
		||||
@@ -550,16 +519,15 @@
 | 
			
		||||
            </button>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div>
 | 
			
		||||
                        / {currentAniListAnime.data.MediaList.media
 | 
			
		||||
                            .nextAiringEpisode.episode !== 0
 | 
			
		||||
                            ? currentAniListAnime.data.MediaList.media
 | 
			
		||||
                                  .nextAiringEpisode.episode - 1
 | 
			
		||||
            / {currentAniListAnime.data.MediaList.media.nextAiringEpisode
 | 
			
		||||
              .episode !== 0
 | 
			
		||||
              ? currentAniListAnime.data.MediaList.media.nextAiringEpisode
 | 
			
		||||
                  .episode - 1
 | 
			
		||||
              : currentAniListAnime.data.MediaList.media.episodes}
 | 
			
		||||
          </div>
 | 
			
		||||
          {#if currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode !== 0}
 | 
			
		||||
            <div>
 | 
			
		||||
                            of {currentAniListAnime.data.MediaList.media
 | 
			
		||||
                                .episodes}
 | 
			
		||||
              of {currentAniListAnime.data.MediaList.media.episodes}
 | 
			
		||||
            </div>
 | 
			
		||||
          {/if}
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -582,7 +550,6 @@
 | 
			
		||||
            {/each}
 | 
			
		||||
          </select>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
      </div>
 | 
			
		||||
      <div
 | 
			
		||||
        class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-16 lg:gap-x-36"
 | 
			
		||||
@@ -632,8 +599,7 @@
 | 
			
		||||
            name="repeat"
 | 
			
		||||
            min="0"
 | 
			
		||||
            id="repeat"
 | 
			
		||||
                        class="border {currentAniListAnime.data.MediaList
 | 
			
		||||
                            .repeat < 0
 | 
			
		||||
            class="border {currentAniListAnime.data.MediaList.repeat < 0
 | 
			
		||||
              ? 'border-red-500 border-[2px] text-rose-300 focus:ring-red-500 focus:border-red-500'
 | 
			
		||||
              : 'border-gray-500 text-white focus:ring-blue-500 focus:border-blue-500'} text-sm rounded-lg block w-24 p-2.5 bg-gray-600 placeholder-gray-400 text-white"
 | 
			
		||||
            bind:value={currentAniListAnime.data.MediaList.repeat}
 | 
			
		||||
@@ -666,7 +632,7 @@
 | 
			
		||||
    <div
 | 
			
		||||
      class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-end"
 | 
			
		||||
    >
 | 
			
		||||
            <Button
 | 
			
		||||
      <button
 | 
			
		||||
        disabled={isSubmitting}
 | 
			
		||||
        id="sync-button"
 | 
			
		||||
        class="text-white {$submitSuccess
 | 
			
		||||
@@ -695,8 +661,8 @@
 | 
			
		||||
          />
 | 
			
		||||
        </svg>
 | 
			
		||||
        Sync Changes
 | 
			
		||||
            </Button>
 | 
			
		||||
            <Button
 | 
			
		||||
      </button>
 | 
			
		||||
      <button
 | 
			
		||||
        class="text-white bg-gray-800 border border-gray-600 focus:outline-none hover:bg-gray-700 focus:ring-4
 | 
			
		||||
                    focus:ring-gray-700 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2
 | 
			
		||||
                    hover:border-gray-600"
 | 
			
		||||
@@ -706,7 +672,7 @@
 | 
			
		||||
        }}
 | 
			
		||||
      >
 | 
			
		||||
        Go Home
 | 
			
		||||
            </Button>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <AnimeTable />
 | 
			
		||||
@@ -715,7 +681,7 @@
 | 
			
		||||
    <div
 | 
			
		||||
      class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-start"
 | 
			
		||||
    >
 | 
			
		||||
            <Button
 | 
			
		||||
      <button
 | 
			
		||||
        disabled={isSubmitting}
 | 
			
		||||
        id="delete-button"
 | 
			
		||||
        class="text-white {$submitSuccess
 | 
			
		||||
@@ -744,12 +710,12 @@
 | 
			
		||||
          />
 | 
			
		||||
        </svg>
 | 
			
		||||
        Delete Entries
 | 
			
		||||
            </Button>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div
 | 
			
		||||
      class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-end"
 | 
			
		||||
    >
 | 
			
		||||
            <Button
 | 
			
		||||
      <button
 | 
			
		||||
        disabled={isSubmitting}
 | 
			
		||||
        id="sync-button"
 | 
			
		||||
        class="text-white {$submitSuccess
 | 
			
		||||
@@ -778,8 +744,8 @@
 | 
			
		||||
          />
 | 
			
		||||
        </svg>
 | 
			
		||||
        Sync Changes
 | 
			
		||||
            </Button>
 | 
			
		||||
            <Button
 | 
			
		||||
      </button>
 | 
			
		||||
      <button
 | 
			
		||||
        class="text-white bg-gray-800 border border-gray-600 focus:outline-none hover:bg-gray-700 focus:ring-4
 | 
			
		||||
                    focus:ring-gray-700 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2
 | 
			
		||||
                    hover:border-gray-600"
 | 
			
		||||
@@ -789,7 +755,7 @@
 | 
			
		||||
        }}
 | 
			
		||||
      >
 | 
			
		||||
        Go Home
 | 
			
		||||
            </Button>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user