Parse watch status on the front

This commit is contained in:
Zoe Roux
2023-12-02 15:33:08 +01:00
parent d1febd13fd
commit db3d7f1f2e
7 changed files with 89 additions and 21 deletions
+1 -2
View File
@@ -19,7 +19,7 @@
*/
import { ReactElement } from "react";
import { MeQuery, Navbar } from "./navbar";
import { Navbar } from "./navbar";
import { useYoshiki, vw } from "yoshiki/native";
import { Main } from "@kyoo/primitives";
@@ -60,4 +60,3 @@ export const DefaultLayout = ({
</>
);
};
DefaultLayout.getFetchUrls = () => [MeQuery];
+2 -17
View File
@@ -18,15 +18,7 @@
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
*/
import {
deleteAccount,
logout,
QueryIdentifier,
useAccount,
useAccounts,
User,
UserP,
} from "@kyoo/models";
import { deleteAccount, logout, useAccount, useAccounts } from "@kyoo/models";
import {
Alert,
Input,
@@ -49,10 +41,8 @@ import Login from "@material-symbols/svg-400/rounded/login.svg";
import Register from "@material-symbols/svg-400/rounded/app_registration.svg";
import Logout from "@material-symbols/svg-400/rounded/logout.svg";
import Delete from "@material-symbols/svg-400/rounded/delete.svg";
import { FetchNE } from "../fetch";
import { KyooLongLogo } from "./icon";
import { forwardRef, useContext, useEffect, useRef, useState } from "react";
import { useQueryClient } from "@tanstack/react-query";
import { forwardRef, useEffect, useRef, useState } from "react";
export const NavbarTitle = (props: Stylable & { onLayout?: ViewProps["onLayout"] }) => {
const { t } = useTranslation();
@@ -95,11 +85,6 @@ const SearchBar = forwardRef<TextInput, Stylable>(function SearchBar(props, ref)
);
});
export const MeQuery: QueryIdentifier<User> = {
path: ["auth", "me"],
parser: UserP,
};
const getDisplayUrl = (url: string) => {
url = url.replace(/\/api$/, "");
url = url.replace(/https?:\/\//, "");