Skip to content

Commit

Permalink
✨ Kreedzt - add default redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreedzt committed Apr 5, 2023
1 parent 094d0b8 commit 56ab22f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rwr-server-ping",
"version": "0.1.0",
"version": "0.1.0-alpha2",
"description": "",
"scripts": {
"start": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "rwr-server-ping"
version = "0.0.0"
version = "0.1.0-alpha2"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
authors = ["Kreedzt"]
license = "GPLv3"
repository = "https://github.com/Kreedzt/rwr-server-ping"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{
"build": {
"beforeDevCommand": "pnpm dev",
Expand All @@ -8,7 +9,7 @@
},
"package": {
"productName": "rwr-server-ping",
"version": "0.1.0"
"version": "0.1.0-alpha2"
},
"tauri": {
"allowlist": {
Expand Down
13 changes: 12 additions & 1 deletion src/entries/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Link, Outlet, Route, Routes, useLocation } from '@solidjs/router';
import {
Link,
Outlet,
Route,
Routes,
useLocation,
useNavigate,
} from '@solidjs/router';
import {
Box,
CircularProgress,
Expand All @@ -19,6 +26,7 @@ import { useI18n } from '@solid-primitives/i18n';

function Home() {
const location = useLocation();
const navigate = useNavigate();
const [initLoading, setInitLoading] = createSignal(false);
const [_t, { locale }] = useI18n();
const t = useTranslate();
Expand All @@ -31,6 +39,9 @@ function Home() {
setInitLoading(true);
contextValue.configStore.init().then((newConfig) => {
locale(newConfig.locale);
if (location.pathname === '/') {
navigate('/about', { replace: true });
}
});
setInitLoading(false);
});
Expand Down

0 comments on commit 56ab22f

Please sign in to comment.