From 78a8091bcd29a7cf50cc7c493c28710389817adf Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Sun, 31 Oct 2021 11:32:57 -0400 Subject: [PATCH] fix(frontend): setup page backdrops (#2251) --- src/components/Setup/index.tsx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/Setup/index.tsx b/src/components/Setup/index.tsx index 9d6642299..c4a754dc4 100644 --- a/src/components/Setup/index.tsx +++ b/src/components/Setup/index.tsx @@ -2,7 +2,7 @@ import axios from 'axios'; import { useRouter } from 'next/router'; import React, { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { mutate } from 'swr'; +import useSWR, { mutate } from 'swr'; import useLocale from '../../hooks/useLocale'; import AppDataWarning from '../AppDataWarning'; import Badge from '../Common/Badge'; @@ -51,18 +51,21 @@ const Setup: React.FC = () => { } }; + const { data: backdrops } = useSWR('/api/v1/backdrops', { + refreshInterval: 0, + refreshWhenHidden: false, + revalidateOnFocus: false, + }); + return (
`https://www.themoviedb.org/t/p/original${backdrop}` + ) ?? [] + } />