diff --git a/apps/onelauncher/frontend/src/components/overlay/popups/AccountPopup.tsx b/apps/onelauncher/frontend/src/components/overlay/popups/AccountPopup.tsx
index 8caaafc3..65fd6c36 100644
--- a/apps/onelauncher/frontend/src/components/overlay/popups/AccountPopup.tsx
+++ b/apps/onelauncher/frontend/src/components/overlay/popups/AccountPopup.tsx
@@ -12,7 +12,7 @@ function AccountPopup() {
const defaultUser = useCommand('getDefaultUser', () => bindings.core.getDefaultUser(false));
const setDefaultUser = (user: MinecraftCredentials) => {
- bindings.core.setDefaultUser(user.id);
+ bindings.commands.setDefaultUser(user.id);
};
return (
diff --git a/apps/onelauncher/frontend/src/routes/app/cluster/route.tsx b/apps/onelauncher/frontend/src/routes/app/cluster/route.tsx
index 3596750c..bccb8424 100644
--- a/apps/onelauncher/frontend/src/routes/app/cluster/route.tsx
+++ b/apps/onelauncher/frontend/src/routes/app/cluster/route.tsx
@@ -22,7 +22,7 @@ function RouteComponent() {
const cluster = useCommand('getClusterById', () => bindings.core.getClusterById(Number(id.toString()) as unknown as bigint));
- const isModded = cluster.data?.mc_loader != 'vanilla';
+ const isModded = cluster.data?.mc_loader !== 'vanilla';
return (
@@ -32,12 +32,12 @@ function RouteComponent() {
links={{
'Cluster Settings': [
// if someone has a better way to do this, please let me know
- [
, 'Overview', `/?id=${id}`],
- (isModded ? [
, 'Mods', `/mods?id=${id}`] : undefined),
- [
, 'Screenshots', `/screenshots?id=${id}`],
- [
, 'Worlds', `/worlds?id=${id}`],
- [
, 'Logs', `/logs?id=${id}`],
- [
, 'Game Settings', `/settings?id=${id}`],
+ [
, 'Overview', `/?id=${id}`],
+ (isModded ? [
, 'Mods', `/mods?id=${id}`] : undefined),
+ [
, 'Screenshots', `/screenshots?id=${id}`],
+ [
, 'Worlds', `/worlds?id=${id}`],
+ [
, 'Logs', `/logs?id=${id}`],
+ [
, 'Game Settings', `/settings?id=${id}`],
],
}}
/>
diff --git a/apps/onelauncher/frontend/src/routes/app/settings/route.tsx b/apps/onelauncher/frontend/src/routes/app/settings/route.tsx
index 48d9c438..3ebb7cc6 100644
--- a/apps/onelauncher/frontend/src/routes/app/settings/route.tsx
+++ b/apps/onelauncher/frontend/src/routes/app/settings/route.tsx
@@ -15,19 +15,19 @@ function RouteComponent() {
base="/app/settings"
links={{
'Launcher Settings': [
- [
, 'General', '/'],
- [
, 'Appearance', '/appearance'],
+ [
, 'General', '/'],
+ [
, 'Appearance', '/appearance'],
// [
, 'APIs', '/apis'],
// [
, 'Language', '/language'],
],
'Game Settings': [
- [
, 'Minecraft settings', '/minecraft'],
- [
, 'Accounts', '/accounts'],
+ [
, 'Minecraft settings', '/minecraft'],
+ [
, 'Accounts', '/accounts'],
],
'About': [
- [
, 'Changelog', '/changelog'],
- [
, 'Feedback', '/feedback'],
- [
, 'Developer Options', '/developer'],
+ [
, 'Changelog', '/changelog'],
+ [
, 'Feedback', '/feedback'],
+ [
, 'Developer Options', '/developer'],
],
}}
/>
@@ -47,13 +47,15 @@ interface SidebarProps {
}
function Sidebar(props: SidebarProps) {
+ const { base, links } = props;
+
const navigate = useNavigate();
const routerState = useRouterState();
const location = routerState.location.pathname;
useEffect(() => {
- if (props.base.endsWith('/'))
+ if (base.endsWith('/'))
throw new Error('Base should not end with a slash');
});
@@ -63,24 +65,25 @@ function Sidebar(props: SidebarProps) {
for (const [key, value] of params)
currParams.set(key, value);
- const url = `${props.base}${href}`;
+ const url = `${base}${href}`;
navigate({ to: url });
}
function isActive(link: string, _params: URLSearchParams | undefined) {
- return location === `${props.base}${link}` || `${location}/` === `${props.base}${link}`;
+ return location === `${base}${link}` || `${location}/` === `${base}${link}`;
}
return (
- {Object.keys(props.links).map((section, i) => (
+ {Object.keys(links).map((section, i) => (
{section.toUpperCase()}
- {props.links[section].map((link, i) => {
+ {links[section].map((link, i) => {
+ // eslint yaps too much tbh
if (!link)
- return;
+ return '';
return (
;
}
-interface OnboardingContextType {
+interface _OnboardingContextType {
setLanguage: (language: Language) => void;
language: () => Language;
@@ -45,28 +45,18 @@ function RouteComponent() {
const currentPath = routerState.location.pathname;
const currentStepIndex = steps.findIndex(path => currentPath === path || currentPath.startsWith(path));
- const progressPercentage = currentStepIndex >= 0 && steps.length > 1
+ const progressPercentage = currentStepIndex >= 0
? (currentStepIndex / (steps.length - 1)) * 100
: 0;
const handleBack = () => {
- console.log('Geri için mevcut yol:', currentPath);
- console.log('Geri için mevcut adım indeksi:', currentStepIndex);
-
if (currentStepIndex > 0) {
const previousStep = steps[currentStepIndex - 1];
- console.log('Geri gidiliyor:', previousStep);
navigate({ to: previousStep as any });
}
- else {
- console.log('Zaten ilk adımda veya adım bulunamadı, geri gidilemez.');
- }
};
const handleNext = () => {
- console.log('İleri için mevcut yol:', currentPath);
- console.log('İleri için mevcut adım indeksi:', currentStepIndex);
-
if (currentStepIndex === -1) {
navigate({ to: steps[0] as any });
return;
@@ -74,16 +64,11 @@ function RouteComponent() {
if (currentStepIndex < steps.length - 1) {
const nextStep = steps[currentStepIndex + 1];
- console.log('İleri gidiliyor:', nextStep);
navigate({ to: nextStep as any });
}
else if (currentStepIndex === steps.length - 1) {
- console.log('Onboarding tamamlandı, /app adresine gidiliyor');
navigate({ to: '/app' as any });
}
- else {
- console.log('Bir sonraki adım belirlenemedi.');
- }
};
return (