React 18 and Vite (#4510)
This commit is contained in:
parent
1bb1b13f6d
commit
21613fa602
244 changed files with 4547 additions and 8933 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import ConfirmationModal from '@/components/elements/ConfirmationModal';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
@ -14,8 +14,8 @@ export default ({ subuser }: { subuser: Subuser }) => {
|
|||
const [loading, setLoading] = useState(false);
|
||||
const [showConfirmation, setShowConfirmation] = useState(false);
|
||||
|
||||
const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);
|
||||
const removeSubuser = ServerContext.useStoreActions((actions) => actions.subusers.removeSubuser);
|
||||
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
||||
const removeSubuser = ServerContext.useStoreActions(actions => actions.subusers.removeSubuser);
|
||||
const { addError, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
|
||||
|
||||
const doDeletion = () => {
|
||||
|
@ -26,7 +26,7 @@ export default ({ subuser }: { subuser: Subuser }) => {
|
|||
setLoading(false);
|
||||
removeSubuser(subuser.uuid);
|
||||
})
|
||||
.catch((error) => {
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
addError({ key: 'users', message: httpErrorToHuman(error) });
|
||||
setShowConfirmation(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue