mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-24 05:17:24 +02:00
log-in will be saved in sessionStorage
This commit is contained in:
parent
2af47dc5ea
commit
3078264d71
@ -29,7 +29,6 @@ class Mod extends React.Component {
|
||||
dataType: "JSON",
|
||||
success: (data) => {
|
||||
let newest_release = JSON.parse(data.data).releases[0];
|
||||
console.log(newest_release);
|
||||
if(newest_release.version != this.props.mod.version) {
|
||||
this_class.setState({
|
||||
newVersionAvailable: true,
|
||||
|
@ -17,10 +17,9 @@ class ModsContent extends React.Component {
|
||||
this.updateModHandler = this.updateModHandler.bind(this);
|
||||
|
||||
this.state = {
|
||||
username: "",
|
||||
userKey: "",
|
||||
username: sessionStorage.getItem("username") || "",
|
||||
userKey: sessionStorage.getItem("userKey") || "",
|
||||
installedMods: [],
|
||||
updateInProgress: false
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,9 +57,14 @@ class ModsContent extends React.Component {
|
||||
type: "success"
|
||||
});
|
||||
|
||||
let user_key = (JSON.parse(data.data))[0];
|
||||
|
||||
sessionStorage.setItem("username", username);
|
||||
sessionStorage.setItem("userKey", user_key);
|
||||
|
||||
this.setState({
|
||||
"username": username,
|
||||
"userKey": (JSON.parse(data.data))[0]
|
||||
"userKey": user_key
|
||||
});
|
||||
},
|
||||
error: (jqXHR) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user