+
+
+
-
-
{ titleItem.PublisherName }
-
{ titleItem.ProductDescription || '' }
-
- {
- titleItem.Categories.map((item, idx) => {
- return (
- { item }
- )
- })
- }
-
+
+
{titleItem.PublisherName}
+
{titleItem.ProductDescription || ""}
+
+ {titleItem.Categories.map((item, idx) => {
+ return (
+
+ {item}
+
+ );
+ })}
-
-
-
-
-
- >
- )}
+
+
+
+
+
+
+ >
);
}
-export default TitleModal
+export default TitleModal;
diff --git a/renderer/i18n.ts b/renderer/i18n.ts
index b3fec63..bd3630f 100644
--- a/renderer/i18n.ts
+++ b/renderer/i18n.ts
@@ -15,8 +15,6 @@ const resources = {
jp,
};
-let streamSettings: any = {}
-
const lng = 'en'
i18n
diff --git a/renderer/pages/gamepad/test.tsx b/renderer/pages/gamepad/test.tsx
index 4f0c4d5..1fdc2de 100644
--- a/renderer/pages/gamepad/test.tsx
+++ b/renderer/pages/gamepad/test.tsx
@@ -2,7 +2,7 @@ import React, { useEffect, useRef } from "react";
import { Button } from "@nextui-org/react";
import { useRouter } from 'next/navigation'
-function gamepadTester() {
+function GamepadTester() {
const router = useRouter()
const timer = useRef(null)
@@ -120,8 +120,7 @@ function gamepadTester() {
const keys = ["index", "id", "connected", "mapping"];
function processController(info) {
- const { elem, gamepad, axes, buttons } = info;
- const lines = [`gamepad : ${gamepad.index}`];
+ const { gamepad, axes, buttons } = info;
for (const key of keys) {
info[key].textContent = gamepad[key];
}
@@ -205,4 +204,4 @@ function gamepadTester() {
);
}
-export default gamepadTester;
+export default GamepadTester;
diff --git a/renderer/pages/home.tsx b/renderer/pages/home.tsx
index 8dfb55a..eeaa97d 100644
--- a/renderer/pages/home.tsx
+++ b/renderer/pages/home.tsx
@@ -1,153 +1,166 @@
-import { useEffect, useState, useRef } from "react"
+import { useEffect, useState, useRef } from "react";
import {
- Button,
- Card,
- CardBody,
- CardFooter,
- Divider,
- Chip
+ Button,
+ Card,
+ CardBody,
+ CardFooter,
+ Divider,
+ Chip,
} from "@nextui-org/react";
-import { useTranslation } from 'react-i18next'
-import { useRouter } from 'next/navigation'
-import Layout from "../components/Layout"
-import AuthModal from "../components/AuthModal"
+import { useTranslation } from "react-i18next";
+import { useRouter } from "next/navigation";
+import Layout from "../components/Layout";
+import AuthModal from "../components/AuthModal";
import Ipc from "../lib/ipc";
-import Loading from '../components/Loading'
+import Loading from "../components/Loading";
import Nav from "../components/Nav";
-import {useTheme} from "next-themes"
-
-import Image from 'next/image';
+import Image from "next/image";
function Home() {
+ const { t } = useTranslation();
- const { t } = useTranslation()
- const { theme, setTheme } = useTheme()
-
- const router = useRouter()
- const [loading, setLoading] = useState(false)
- const [loadingText, setLoadingText] = useState('')
- const [isLogined, setIsLogined] = useState(true)
- const [showLoginModal, setShowLoginModal] = useState(false)
- const [consoles, setConsoles] = useState([])
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+ const [loadingText, setLoadingText] = useState("");
+ const [isLogined, setIsLogined] = useState(true);
+ const [showLoginModal, setShowLoginModal] = useState(false);
+ const [consoles, setConsoles] = useState([]);
- const authInterval = useRef(null)
+ const authInterval = useRef(null);
useEffect(() => {
- setLoading(true)
- setLoadingText('Loading...')
- Ipc.send('app', 'checkAuthentication').then(isLogin => {
- if (isLogin) { // Silence login, refresh token
- console.log('Silence login, refresh token')
+ setLoading(true);
+ setLoadingText("Loading...");
+ Ipc.send("app", "checkAuthentication").then((isLogin) => {
+ if (isLogin) {
+ // Silence login, refresh token
+ console.log("Silence login, refresh token");
authInterval.current = setInterval(() => {
- console.log('Requesting AuthState...')
-
- Ipc.send('app', 'getAuthState').then(args => {
- console.log('Received AuthState:', args)
-
- if(args.isAuthenticating === true){
- setLoading(true)
- } else if(args.isAuthenticated === true && args.user.signedIn === true){
- clearInterval(authInterval.current)
- setIsLogined(true)
-
- // Get Consoles
- setLoadingText('Fetching consoles...')
- Ipc.send('consoles', 'get').then(res => {
- console.log('consoles:', res)
- setConsoles(res)
- setLoading(false)
- })
- }
- })
- }, 500)
+ console.log("Requesting AuthState...");
+
+ Ipc.send("app", "getAuthState").then((args) => {
+ console.log("Received AuthState:", args);
+
+ if (args.isAuthenticating === true) {
+ setLoading(true);
+ } else if (
+ args.isAuthenticated === true &&
+ args.user.signedIn === true
+ ) {
+ clearInterval(authInterval.current);
+ setIsLogined(true);
+
+ // Get Consoles
+ setLoadingText("Fetching consoles...");
+ Ipc.send("consoles", "get").then((res) => {
+ console.log("consoles:", res);
+ setConsoles(res);
+ setLoading(false);
+ });
+ }
+ });
+ }, 500);
} else {
- console.log('Full auth flow')
- setLoading(false)
- setShowLoginModal(true)
+ console.log("Full auth flow");
+ setLoading(false);
+ setShowLoginModal(true);
}
- })
-
+ });
+
return () => {
- if(authInterval.current) clearInterval(authInterval.current)
- }
- }, [])
+ if (authInterval.current) clearInterval(authInterval.current);
+ };
+ }, []);
const handleLogin = () => {
- setLoading(true)
- setLoadingText('Loading...')
- Ipc.send('app', 'login').then(() => {
- setShowLoginModal(false)
+ setLoading(true);
+ setLoadingText("Loading...");
+ Ipc.send("app", "login").then(() => {
+ setShowLoginModal(false);
// Check login state
authInterval.current = setInterval(() => {
- console.log('Requesting AuthState...')
- Ipc.send('app', 'getAuthState').then(args => {
- console.log('Received AuthState:', args)
-
- if(args.isAuthenticating === true){
- setLoading(true)
- } else if(args.isAuthenticated === true && args.user.signedIn === true){
- clearInterval(authInterval.current)
- setIsLogined(true)
- window.sessionStorage.setItem('isLogined', '1')
- setLoading(false)
-
- // Get Consoles
- setLoadingText('Fetching consoles...')
- Ipc.send('consoles', 'get').then(res => {
- console.log('consoles:', res)
- setConsoles(res)
- })
- }
- })
- }, 500)
- })
- }
+ console.log("Requesting AuthState...");
+ Ipc.send("app", "getAuthState").then((args) => {
+ console.log("Received AuthState:", args);
+
+ if (args.isAuthenticating === true) {
+ setLoading(true);
+ } else if (
+ args.isAuthenticated === true &&
+ args.user.signedIn === true
+ ) {
+ clearInterval(authInterval.current);
+ setIsLogined(true);
+ window.sessionStorage.setItem("isLogined", "1");
+ setLoading(false);
+
+ // Get Consoles
+ setLoadingText("Fetching consoles...");
+ Ipc.send("consoles", "get").then((res) => {
+ console.log("consoles:", res);
+ setConsoles(res);
+ });
+ }
+ });
+ }, 500);
+ });
+ };
const startSession = (sessionId) => {
- console.log('sessionId:', sessionId)
- router.push('stream/' + sessionId)
- }
+ console.log("sessionId:", sessionId);
+ router.push("stream/" + sessionId);
+ };
return (
<>
-