mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-08 00:14:07 +08:00
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:
parent
67f3b0734d
commit
0283cba792
3 changed files with 5 additions and 3 deletions
|
|
@ -216,7 +216,7 @@ export const CONFIGURATION_FORM_SCHEMA: ObjectSchema = {
|
|||
fields: {
|
||||
signUp: {
|
||||
type: "boolean",
|
||||
label: "Enabled",
|
||||
label: "Sign Up Enabled",
|
||||
},
|
||||
xp: {
|
||||
type: "object",
|
||||
|
|
|
|||
|
|
@ -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 () {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue