chore: linting issues
This commit is contained in:
1 parent
d3b367b948
commit
d727eb7cde
4 files changed
+49
-36
No files matched your search
Vendored
+12
@@ -10,6 +10,18 @@
|
|||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "biomejs.biome"
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
},
|
},
|
||||||
|
"[typescriptreact]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"[javascriptreact]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
"rust-analyzer.linkedProjects": ["./src-tauri/Cargo.toml"],
|
"rust-analyzer.linkedProjects": ["./src-tauri/Cargo.toml"],
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib"
|
||||||
}
|
}
|
||||||
+6
-4
@@ -34,7 +34,6 @@ import DialogContentText from "@mui/material/DialogContentText";
|
|||||||
import DialogTitle from "@mui/material/DialogTitle";
|
import DialogTitle from "@mui/material/DialogTitle";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
import Slide from "@mui/material/Slide";
|
|
||||||
import SvgIcon from "@mui/material/SvgIcon";
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
@@ -48,7 +47,12 @@ import FavoritePage from "./routes/favorite/index.jsx";
|
|||||||
import Home from "./routes/home";
|
import Home from "./routes/home";
|
||||||
import ItemDetail from "./routes/item";
|
import ItemDetail from "./routes/item";
|
||||||
import LibraryView from "./routes/library";
|
import LibraryView from "./routes/library";
|
||||||
import { LoginRoute, LoginWithImage, UserLogin, UserLoginManual } from "./routes/login";
|
import {
|
||||||
|
LoginRoute,
|
||||||
|
LoginWithImage,
|
||||||
|
UserLogin,
|
||||||
|
UserLoginManual,
|
||||||
|
} from "./routes/login";
|
||||||
import PersonTitlePage from "./routes/person/index.jsx";
|
import PersonTitlePage from "./routes/person/index.jsx";
|
||||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||||
@@ -100,7 +104,6 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { ErrorBoundary } from "react-error-boundary";
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||||
import { useKonamiEasterEgg } from "./utils/misc/konami";
|
|
||||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||||
|
|
||||||
// const anim = {
|
// const anim = {
|
||||||
@@ -137,7 +140,6 @@ import { handleRelaunch } from "./utils/misc/relaunch";
|
|||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||||
const [easterEgg, setEasterEgg] = useKonamiEasterEgg();
|
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
|
const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
|
||||||
|
|||||||
+18
-17
@@ -33,12 +33,13 @@ const handleAuthError = async () => {
|
|||||||
setInitialRoute("/login/index");
|
setInitialRoute("/login/index");
|
||||||
};
|
};
|
||||||
|
|
||||||
const authenticateUser = async (address: string, api: Api, user: UserStore["user"]) => {
|
const authenticateUser = async (
|
||||||
|
address: string,
|
||||||
|
api: Api,
|
||||||
|
user: UserStore["user"],
|
||||||
|
) => {
|
||||||
try {
|
try {
|
||||||
const auth = await api.authenticateUserByName(
|
const auth = await api.authenticateUserByName(user.Name, user.Password);
|
||||||
user.Name,
|
|
||||||
user.Password
|
|
||||||
);
|
|
||||||
|
|
||||||
if (auth.status !== 200 || !auth.data.AccessToken) {
|
if (auth.status !== 200 || !auth.data.AccessToken) {
|
||||||
enqueueSnackbar("Incorrect Username or Password!", {
|
enqueueSnackbar("Incorrect Username or Password!", {
|
||||||
@@ -98,16 +99,16 @@ const init = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
await init();
|
init().then(() => {
|
||||||
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<QueryClientProvider client={queryClient}>
|
||||||
|
<Router>
|
||||||
|
<App />
|
||||||
|
</Router>
|
||||||
|
</QueryClientProvider>
|
||||||
|
</React.StrictMode>,
|
||||||
|
);
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
document.querySelector(".app-loading")!.setAttribute("style", "display:none");
|
||||||
<React.StrictMode>
|
});
|
||||||
<QueryClientProvider client={queryClient}>
|
|
||||||
<Router>
|
|
||||||
<App />
|
|
||||||
</Router>
|
|
||||||
</QueryClientProvider>
|
|
||||||
</React.StrictMode>
|
|
||||||
);
|
|
||||||
|
|
||||||
document.querySelector(".app-loading")!.setAttribute("style", "display:none");
|
|
||||||
+13
-15
@@ -1,26 +1,24 @@
|
|||||||
import { appLocalDataDir, join } from "@tauri-apps/api/path";
|
|
||||||
import { Store } from "tauri-plugin-store-api";
|
import { Store } from "tauri-plugin-store-api";
|
||||||
|
|
||||||
export interface UserStore {
|
export interface UserStore {
|
||||||
user: {
|
user: {
|
||||||
Name: string;
|
Name: string;
|
||||||
Password: string;
|
Password: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const base = await appLocalDataDir();
|
const user = new Store(".user.dat");
|
||||||
const user = new Store(await join(base, ".user.dat"));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set User details to .user.dat
|
* Set User details to .user.dat
|
||||||
*/
|
*/
|
||||||
const saveUser = async (userName: string, userPassword?: string) => {
|
const saveUser = async (userName: string, userPassword?: string) => {
|
||||||
user.set("user", {
|
user.set("user", {
|
||||||
Name: userName,
|
Name: userName,
|
||||||
Password: userPassword,
|
Password: userPassword,
|
||||||
});
|
});
|
||||||
|
|
||||||
await user.save();
|
await user.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,15 +26,15 @@ const saveUser = async (userName: string, userPassword?: string) => {
|
|||||||
* @return {object}
|
* @return {object}
|
||||||
*/
|
*/
|
||||||
const getUser = async () => {
|
const getUser = async () => {
|
||||||
return user.get<UserStore["user"]>("user");
|
return user.get<UserStore["user"]>("user");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete user from storage
|
* Delete user from storage
|
||||||
*/
|
*/
|
||||||
const delUser = async () => {
|
const delUser = async () => {
|
||||||
await user.clear();
|
await user.clear();
|
||||||
await user.save();
|
await user.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
export { saveUser, getUser, delUser };
|
export { saveUser, getUser, delUser };
|
||||||
Reference in new issue
Block a user