Replace profile URI to use username (#3598) Bruception

* Replace Profile URL to use username

* Remove Auth import

* using replace state to fix back button not working

Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
Bruce Berrios 2022-09-26 04:51:52 -04:00 committed by GitHub
parent 67f3b0734d
commit 0283cba792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -216,7 +216,7 @@ export const CONFIGURATION_FORM_SCHEMA: ObjectSchema = {
fields: {
signUp: {
type: "boolean",
label: "Enabled",
label: "Sign Up Enabled",
},
xp: {
type: "object",

View file

@ -16,7 +16,6 @@ import * as Profile from "../elements/profile";
import format from "date-fns/format";
import type { ScaleChartOptions } from "chart.js";
import { Auth } from "../firebase";
let filterDebug = false;
//toggle filterdebug
@ -1110,7 +1109,8 @@ $(".pageAccount .content .group.aboveHistory .exportCSV").on("click", () => {
});
$(document).on("click", ".pageAccount .profile .details .copyLink", () => {
const url = `${location.origin}/profile/${Auth.currentUser?.uid}?isUid`;
const { name } = DB.getSnapshot();
const url = `${location.origin}/profile/${name}`;
navigator.clipboard.writeText(url).then(
function () {

View file

@ -161,6 +161,8 @@ async function update(options: UpdateOptions): Promise<void> {
);
}
window.history.replaceState(null, "", `/profile/${response.data.name}`);
Profile.update("profile", response.data);
PbTables.update(response.data.personalBests, true);
} else {