Skip to content

Commit 225767e

Browse files
Merge pull request #14 from GreenSoap/development
Development
2 parents 9a124c7 + 73ced70 commit 225767e

File tree

5 files changed

+10
-39
lines changed

5 files changed

+10
-39
lines changed

backend/track.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ func (a *App) StartTracking(profile string, restoreData bool) {
4040

4141
fmt.Println("Loading profile")
4242
PageInstance.MustNavigate(`https://game.capcom.com/cfn/sfv/profile/` + profile).MustWaitLoad()
43+
isValidProfile, _, _ := PageInstance.Has(`.leagueInfo`)
44+
if isValidProfile == false {
45+
runtime.EventsEmit(a.ctx, `stopped-tracking`)
46+
return
47+
}
48+
4349
IsTracking = true
4450
fmt.Println("Profile loaded")
4551

@@ -134,8 +140,10 @@ func (a *App) FetchData(profile string, page *rod.Page, isFirstFetch bool) {
134140

135141
hasNewMatch := totalMatches != CurrentMatchHistory.TotalMatches
136142

137-
if isFirstFetch {
143+
if isFirstFetch && CurrentMatchHistory.LPGain == 0 {
138144
FirstLPRecorded = newLp
145+
} else if isFirstFetch && CurrentMatchHistory.LPGain != 0 {
146+
FirstLPRecorded = newLp - CurrentMatchHistory.LPGain
139147
}
140148

141149
// Revalidate LP gain, because of CFN revalidations

frontend/src/index.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
body {
66
font-family: 'League Spartan', sans-serif;
7-
/*background: rgba(27,38,54,.25);
8-
/*background-color: #181a3b;*/
97
background: radial-gradient(circle at 52.1% -29.6%, rgb(144, 17, 105) 0%, rgb(51, 0, 131) 100.2%);
108
overflow: hidden;
119
border-radius: 14px;

frontend/src/main.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
} from "react-router-dom";
77
import Root from "./routes/root";
88
import History from "./routes/history";
9-
import Statistics from "./routes/statistics";
10-
119
import './i18n';
1210
import './index.css'
1311
import Wrapper from './components/Wrapper';
@@ -21,10 +19,6 @@ const router = createHashRouter([
2119
path: "/history",
2220
element: <Wrapper><History /></Wrapper>,
2321
},
24-
{
25-
path: "/statistics",
26-
element: <Wrapper><Statistics /></Wrapper>,
27-
},
2822
]);
2923

3024

frontend/src/routes/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const Root = () => {
5454
setInitialized(isInitialized);
5555
});
5656
}
57-
}, []);
57+
}, [isTracking, isInitialized]);
5858

5959
return (
6060
<main className="grid grid-rows-[0fr_1fr] min-h-screen max-h-screen z-40 flex-1 text-white mx-auto">

frontend/src/routes/statistics.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)