Skip to content

Commit

Permalink
Update app to 1.0.7, and fix the connection status screen
Browse files Browse the repository at this point in the history
  • Loading branch information
cuttlefishi committed Mar 14, 2024
1 parent b1e8cb1 commit 7a28a7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ android {
applicationId 'com.onefi.XOneFiApp'
minSdkVersion 26
targetSdkVersion 33
versionCode 5
versionName "1.0.6"
versionCode 6
versionName "1.0.7"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
multiDexEnabled true

Expand Down
2 changes: 1 addition & 1 deletion src/screens/AccountInformationScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function AccountInformationScreen({ navigation, userContext_array }) {
LeftText={"Current Version"}
RightSideComponent={
<View className="rounded-md border-slate-600 bg-slate-600 pl-3 pr-3 py-1">
<Text className="text-white">1.0.6</Text>
<Text className="text-white">1.0.7</Text>
</View>
}
/>
Expand Down
20 changes: 7 additions & 13 deletions src/screens/ConnectStatusScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const ConnectStatusScreen: RouteComponent<"Status"> = (props) => {
//This is a state variable for if the User is connected to a Provider. This variable is gotten by reading the default config
//The devolper has a connectStatus object which holds information form the dummy data. Might need to delte this
const [isConnected, setIsConnected] = useState<boolean>(false);
const [lastSackTimestamp, setLastSackTimestap] = useState(0);
const [initialSackTimestamp, setInitialSackTimestamp] = useState(0);
const [lastSackNum, setLastSackNum] = useState(0);
const [usageCost, setUsageCost] = useState(25);


Expand Down Expand Up @@ -79,16 +78,11 @@ const ConnectStatusScreen: RouteComponent<"Status"> = (props) => {
let interval = setInterval(() => {
if(isConnected == true){
read_default_config((config_json) => {
const lastSackTime = config_json.client_session.last_sack_timestamp
setLastSackTimestap(lastSackTime)

if(lastSackTime > 0){
const initalTimestamp = config_json.client_session.started_timestamp
setInitialSackTimestamp(initalTimestamp)
}
const lastSackNum = config_json.client_session.sack_number
setLastSackNum(lastSackNum)
});
}
}, 60000);
}, 30000);

return () => {
clearInterval(interval);
Expand All @@ -106,11 +100,11 @@ const ConnectStatusScreen: RouteComponent<"Status"> = (props) => {
<View
style={[style.summaryItem, style.summaryItemValueWithoutBorder]}
>
<Text style={style.summaryItemValue}>{Number((Math.floor((lastSackTimestamp-initialSackTimestamp)/60)) * (usageCost/60)).toFixed(2)}</Text>
<Text style={style.summaryItemValue}>{Number(lastSackNum * (usageCost/60)).toFixed(2)}</Text>
<Text style={style.summaryDesc}>OFI TOKENS</Text>
</View>
<View style={style.summaryItem}>
<Text style={style.summaryItemValue}>{Math.floor((lastSackTimestamp-initialSackTimestamp)/60)}</Text>
<Text style={style.summaryItemValue}>{lastSackNum}</Text>
<Text style={style.summaryDesc}>MINUTES</Text>
</View>
<View style={style.summaryItem}>
Expand Down Expand Up @@ -174,7 +168,7 @@ const ConnectStatusScreen: RouteComponent<"Status"> = (props) => {
<Text style={[style.descriptionItem, { width: "69%" }]}>
Usage Time
</Text>
<Text style={style.descriptionItem}>{Math.floor((lastSackTimestamp-initialSackTimestamp)/60)} min</Text>
<Text style={style.descriptionItem}>{lastSackNum} min</Text>
</View>
</Card>
<View
Expand Down

0 comments on commit 7a28a7f

Please sign in to comment.