fix: clean up unused imports and improve TOTP QR code rendering
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState, useEffect, useCallback, useMemo } from 'react';
|
import { useState, useEffect, useMemo } from 'react';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import QRCode from 'qrcode';
|
import QRCode from 'qrcode';
|
||||||
import * as OTPAuth from 'otpauth';
|
import * as OTPAuth from 'otpauth';
|
||||||
@@ -294,7 +294,6 @@ function TotpSection() {
|
|||||||
<p className="text-xs text-muted-foreground">{t('totp.setup_instructions')}</p>
|
<p className="text-xs text-muted-foreground">{t('totp.setup_instructions')}</p>
|
||||||
{qrDataUrl && (
|
{qrDataUrl && (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
{ /* eslint-disable-next-line @next/next/no-img-element */ }
|
|
||||||
<img src={qrDataUrl} alt="TOTP QR code" className="rounded bg-white p-2" />
|
<img src={qrDataUrl} alt="TOTP QR code" className="rounded bg-white p-2" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -190,8 +190,7 @@ export const useAccountSecurityStore = create<AccountSecurityState>()((set, get)
|
|||||||
const acc = result.list?.[0];
|
const acc = result.list?.[0];
|
||||||
const aliasAddresses = acc?.aliases
|
const aliasAddresses = acc?.aliases
|
||||||
? Object.values(acc.aliases)
|
? Object.values(acc.aliases)
|
||||||
.filter((a) => a?.enabled !== false && a?.name)
|
.flatMap((a) => (a && a.enabled !== false && a.name ? [a.name] : []))
|
||||||
.map((a) => a?.name!)
|
|
||||||
: [];
|
: [];
|
||||||
const primaryEmail = acc?.name ? [acc.name] : [];
|
const primaryEmail = acc?.name ? [acc.name] : [];
|
||||||
set({
|
set({
|
||||||
|
|||||||
Reference in New Issue
Block a user