[fix] errors with default empty steam users + loading process
This commit is contained in:
@@ -12,16 +12,7 @@ const defaultValue = {
|
||||
cs2DirValid: false,
|
||||
steamDirChecking: false,
|
||||
cs2DirChecking: false,
|
||||
users: [
|
||||
{
|
||||
steamID64: "76561198052315353",
|
||||
steamID32: "46157676",
|
||||
accountName: "wrr_account",
|
||||
personaName: "wrr",
|
||||
recent: 0,
|
||||
avatar: "",
|
||||
},
|
||||
] as SteamUser[],
|
||||
users: [] as SteamUser[],
|
||||
}
|
||||
|
||||
export const steamStore = store(
|
||||
@@ -51,7 +42,7 @@ export const useSteamStore = () => {
|
||||
}
|
||||
|
||||
const cs2BaseDir = () => {
|
||||
return path.normalize(`${steamStore.state.cs2Dir.replaceAll("\\", "/") }/../../..`)
|
||||
return path.normalize(`${steamStore.state.cs2Dir.replaceAll("\\", "/")}/../../..`)
|
||||
}
|
||||
|
||||
const setDir = (dir: string) => {
|
||||
@@ -97,7 +88,7 @@ const checkCs2DirValid = async () => {
|
||||
}
|
||||
|
||||
const currentUser = () => {
|
||||
return steamStore.state.users[0] || defaultValue.users[0]
|
||||
return steamStore.state.users.at(0) || undefined
|
||||
}
|
||||
|
||||
const resetSteamStore = () => {
|
||||
|
||||
Reference in New Issue
Block a user