mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-21 08:40:32 +02:00
fix: Change address to id field in url
This commit is contained in:
parent
279406b9c7
commit
9a7b868301
@ -81,7 +81,7 @@ const router = createBrowserRouter([
|
|||||||
element: <AliasesRoute />,
|
element: <AliasesRoute />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/aliases/:addressInBase64",
|
path: "/aliases/:id",
|
||||||
element: <AliasDetailRoute />,
|
element: <AliasDetailRoute />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,7 @@ export default function AliasesListItem({
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
component={isInCopyAddressMode ? undefined : RouterLink}
|
component={isInCopyAddressMode ? undefined : RouterLink}
|
||||||
key={alias.id}
|
key={alias.id}
|
||||||
to={isInCopyAddressMode ? undefined : `/aliases/${btoa(address)}`}
|
to={isInCopyAddressMode ? undefined : `/aliases/${alias.id}`}
|
||||||
onClick={(event: any) => {
|
onClick={(event: any) => {
|
||||||
if (isInCopyAddressMode) {
|
if (isInCopyAddressMode) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
@ -25,13 +25,12 @@ import decryptAliasNotes from "~/apis/helpers/decrypt-alias-notes"
|
|||||||
|
|
||||||
export default function AliasDetailRoute(): ReactElement {
|
export default function AliasDetailRoute(): ReactElement {
|
||||||
const {t} = useTranslation()
|
const {t} = useTranslation()
|
||||||
const params = useParams()
|
const {id: aliasID} = useParams()
|
||||||
const address = atob(params.addressInBase64 as string)
|
|
||||||
const {_decryptUsingMasterPassword, encryptionStatus} = useContext(AuthContext)
|
const {_decryptUsingMasterPassword, encryptionStatus} = useContext(AuthContext)
|
||||||
const queryKey = ["get_alias", address, encryptionStatus]
|
const queryKey = ["get_alias", aliasID, encryptionStatus]
|
||||||
|
|
||||||
const query = useQuery<Alias | DecryptedAlias, AxiosError>(queryKey, async () => {
|
const query = useQuery<Alias | DecryptedAlias, AxiosError>(queryKey, async () => {
|
||||||
const alias = await getAlias(address)
|
const alias = await getAlias(aliasID!)
|
||||||
|
|
||||||
if (encryptionStatus === EncryptionStatus.Available) {
|
if (encryptionStatus === EncryptionStatus.Available) {
|
||||||
;(alias as any as DecryptedAlias).notes = decryptAliasNotes(
|
;(alias as any as DecryptedAlias).notes = decryptAliasNotes(
|
||||||
@ -60,7 +59,7 @@ export default function AliasDetailRoute(): ReactElement {
|
|||||||
<AliasTypeIndicator type={alias.type} />
|
<AliasTypeIndicator type={alias.type} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<AliasAddress address={address} />
|
<AliasAddress address={`${alias.local}@${alias.domain}`} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<ChangeAliasActivationStatusSwitch
|
<ChangeAliasActivationStatusSwitch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user