fix: merge style bugs
This commit is contained in:
@@ -17,6 +17,7 @@ import { type ApiSession } from '../types/settingsApiType';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { formatDate } from '@/utils/formatSessionDate';
|
||||
import { type Device } from '../types/settingsType';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
|
||||
export function ActiveDevicesPage() {
|
||||
const { t, i18n } = useTranslation('setting');
|
||||
@@ -24,6 +25,7 @@ export function ActiveDevicesPage() {
|
||||
const [loadingDeleteIds, setLoadingDeleteIds] = useState<string[]>([]);
|
||||
const theme = useTheme();
|
||||
const isXsup = useMediaQuery(theme.breakpoints.up('xs'));
|
||||
const showToast = useToast();
|
||||
|
||||
const {
|
||||
data: profileData,
|
||||
@@ -65,10 +67,17 @@ export function ActiveDevicesPage() {
|
||||
if (data.success) {
|
||||
setDevices((prevDevices) => prevDevices.filter((d) => d.id !== id));
|
||||
} else {
|
||||
console.error('Delete failed:', data.message);
|
||||
showToast({
|
||||
message: data.message || t('active.deleteFailed'),
|
||||
severity: 'error',
|
||||
});
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
console.error('Delete error:', error);
|
||||
// console.error('Delete error:', error);
|
||||
showToast({
|
||||
message: t('active.deleteFailed'),
|
||||
severity: 'error',
|
||||
});
|
||||
} finally {
|
||||
setLoadingDeleteIds((prev) =>
|
||||
prev.filter((loadingId) => loadingId !== id),
|
||||
@@ -104,6 +113,9 @@ export function ActiveDevicesPage() {
|
||||
borderColor: 'error.main',
|
||||
color: 'error.main',
|
||||
textTransform: 'none',
|
||||
flexShrink: 0,
|
||||
flexGrow: 0,
|
||||
width: 'auto',
|
||||
}}
|
||||
disabled={isLoading || isTerminating}
|
||||
>
|
||||
@@ -215,6 +227,7 @@ export function ActiveDevicesPage() {
|
||||
whiteSpace: 'nowrap',
|
||||
color: 'success.main',
|
||||
textTransform: 'none',
|
||||
maxWidth: '125px',
|
||||
'&.Mui-disabled': {
|
||||
color: 'success.main',
|
||||
borderColor: 'success.main',
|
||||
|
||||
Reference in New Issue
Block a user