mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-01 17:25:23 +08:00
Open prevent redirect to /profile/undefined when going to the page of a non-existing profile(#3725) FurriousFox
fix it automatically changing the url in the url bar (which gets requested if someone reloads the page) to https://monkeytype.com/profile/undefined (which apparently is already the username of an existing user) when going to the profile of a non-existent user (for ex. https://monkeytype.com/profile/dfjksahjkadfsjhkasfhjkadhjksf )
This commit is contained in:
parent
d8b5f818c7
commit
192cd999ca
1 changed files with 2 additions and 2 deletions
|
@ -170,10 +170,10 @@ async function update(options: UpdateOptions): Promise<void> {
|
|||
"Failed to load profile: " + response.message,
|
||||
-1
|
||||
);
|
||||
} else {
|
||||
window.history.replaceState(null, "", `/profile/${response.data.name}`);
|
||||
}
|
||||
|
||||
window.history.replaceState(null, "", `/profile/${response.data.name}`);
|
||||
|
||||
Profile.update("profile", response.data);
|
||||
PbTables.update(response.data.personalBests, true);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue