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]": {
|
||||
"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"],
|
||||
"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 IconButton from "@mui/material/IconButton";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Slide from "@mui/material/Slide";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
@@ -48,7 +47,12 @@ import FavoritePage from "./routes/favorite/index.jsx";
|
||||
import Home from "./routes/home";
|
||||
import ItemDetail from "./routes/item";
|
||||
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 { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||
@@ -100,7 +104,6 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||
import { useKonamiEasterEgg } from "./utils/misc/konami";
|
||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||
|
||||
// const anim = {
|
||||
@@ -137,7 +140,6 @@ import { handleRelaunch } from "./utils/misc/relaunch";
|
||||
|
||||
function App() {
|
||||
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||
const [easterEgg, setEasterEgg] = useKonamiEasterEgg();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
|
||||
|
||||
+18
-17
@@ -33,12 +33,13 @@ const handleAuthError = async () => {
|
||||
setInitialRoute("/login/index");
|
||||
};
|
||||
|
||||
const authenticateUser = async (address: string, api: Api, user: UserStore["user"]) => {
|
||||
const authenticateUser = async (
|
||||
address: string,
|
||||
api: Api,
|
||||
user: UserStore["user"],
|
||||
) => {
|
||||
try {
|
||||
const auth = await api.authenticateUserByName(
|
||||
user.Name,
|
||||
user.Password
|
||||
);
|
||||
const auth = await api.authenticateUserByName(user.Name, user.Password);
|
||||
|
||||
if (auth.status !== 200 || !auth.data.AccessToken) {
|
||||
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(
|
||||
<React.StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Router>
|
||||
<App />
|
||||
</Router>
|
||||
</QueryClientProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
document.querySelector(".app-loading")!.setAttribute("style", "display:none");
|
||||
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";
|
||||
|
||||
export interface UserStore {
|
||||
user: {
|
||||
Name: string;
|
||||
Password: string;
|
||||
};
|
||||
user: {
|
||||
Name: string;
|
||||
Password: string;
|
||||
};
|
||||
}
|
||||
|
||||
const base = await appLocalDataDir();
|
||||
const user = new Store(await join(base, ".user.dat"));
|
||||
const user = new Store(".user.dat");
|
||||
|
||||
/**
|
||||
* Set User details to .user.dat
|
||||
*/
|
||||
const saveUser = async (userName: string, userPassword?: string) => {
|
||||
user.set("user", {
|
||||
Name: userName,
|
||||
Password: userPassword,
|
||||
});
|
||||
user.set("user", {
|
||||
Name: userName,
|
||||
Password: userPassword,
|
||||
});
|
||||
|
||||
await user.save();
|
||||
await user.save();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -28,15 +26,15 @@ const saveUser = async (userName: string, userPassword?: string) => {
|
||||
* @return {object}
|
||||
*/
|
||||
const getUser = async () => {
|
||||
return user.get<UserStore["user"]>("user");
|
||||
return user.get<UserStore["user"]>("user");
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete user from storage
|
||||
*/
|
||||
const delUser = async () => {
|
||||
await user.clear();
|
||||
await user.save();
|
||||
await user.clear();
|
||||
await user.save();
|
||||
};
|
||||
|
||||
export { saveUser, getUser, delUser };
|
||||
Reference in new issue
Block a user