yarn and composer updates
This commit is contained in:
parent
d167ef1f89
commit
e4fc0f5ac3
19 changed files with 3022 additions and 2342 deletions
|
@ -9,8 +9,8 @@ const InstallListener = () => {
|
|||
const { mutate } = useFileManagerSwr();
|
||||
const setServerFromState = ServerContext.useStoreActions(actions => actions.server.setServerFromState);
|
||||
|
||||
useWebsocketEvent(SocketEvent.BACKUP_RESTORE_COMPLETED, () => {
|
||||
mutate(undefined);
|
||||
useWebsocketEvent(SocketEvent.BACKUP_RESTORE_COMPLETED, async () => {
|
||||
await mutate(undefined);
|
||||
setServerFromState(s => ({ ...s, status: null }));
|
||||
});
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ export default ({ backup }: Props) => {
|
|||
setLoading(true);
|
||||
clearFlashes('backups');
|
||||
deleteBackup(uuid, backup.uuid)
|
||||
.then(() => mutate(data => ({
|
||||
.then(async () => await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.filter(b => b.uuid !== backup.uuid),
|
||||
backupCount: data!.backupCount - 1,
|
||||
|
@ -83,7 +83,7 @@ export default ({ backup }: Props) => {
|
|||
}
|
||||
|
||||
http.post(`/api/client/servers/${uuid}/backups/${backup.uuid}/lock`)
|
||||
.then(() => mutate(data => ({
|
||||
.then(async () => await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.map(b => b.uuid !== backup.uuid ? b : {
|
||||
...b,
|
||||
|
|
|
@ -21,11 +21,11 @@ interface Props {
|
|||
export default ({ backup, className }: Props) => {
|
||||
const { mutate } = getServerBackups();
|
||||
|
||||
useWebsocketEvent(`${SocketEvent.BACKUP_COMPLETED}:${backup.uuid}` as SocketEvent, data => {
|
||||
useWebsocketEvent(`${SocketEvent.BACKUP_COMPLETED}:${backup.uuid}` as SocketEvent, async (data) => {
|
||||
try {
|
||||
const parsed = JSON.parse(data);
|
||||
|
||||
mutate(data => ({
|
||||
await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.map(b => b.uuid !== backup.uuid ? b : ({
|
||||
...b,
|
||||
|
|
|
@ -80,8 +80,8 @@ export default () => {
|
|||
const submit = (values: Values, { setSubmitting }: FormikHelpers<Values>) => {
|
||||
clearFlashes('backups:create');
|
||||
createServerBackup(uuid, values)
|
||||
.then(backup => {
|
||||
mutate(data => ({ ...data!, items: data!.items.concat(backup), backupCount: data!.backupCount + 1 }), false);
|
||||
.then(async (backup) => {
|
||||
await mutate(data => ({ ...data!, items: data!.items.concat(backup), backupCount: data!.backupCount + 1 }), false);
|
||||
setVisible(false);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
@ -28,18 +28,18 @@ const ChmodFileModal = ({ files, ...props }: OwnProps) => {
|
|||
const directory = ServerContext.useStoreState(state => state.files.directory);
|
||||
const setSelectedFiles = ServerContext.useStoreActions(actions => actions.files.setSelectedFiles);
|
||||
|
||||
const submit = ({ mode }: FormikValues, { setSubmitting }: FormikHelpers<FormikValues>) => {
|
||||
const submit = async ({ mode }: FormikValues, { setSubmitting }: FormikHelpers<FormikValues>) => {
|
||||
clearFlashes('files');
|
||||
|
||||
mutate(data => data!.map(f => f.name === files[0].file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f), false);
|
||||
await mutate(data => data!.map(f => f.name === files[0].file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f), false);
|
||||
|
||||
const data = files.map(f => ({ file: f.file, mode: mode }));
|
||||
|
||||
chmodFiles(uuid, directory, data)
|
||||
.then((): Promise<any> => files.length > 0 ? mutate() : Promise.resolve())
|
||||
.then(async (): Promise<any> => files.length > 0 ? await mutate() : Promise.resolve())
|
||||
.then(() => setSelectedFiles([]))
|
||||
.catch(error => {
|
||||
mutate();
|
||||
.catch(async (error) => {
|
||||
await mutate();
|
||||
setSubmitting(false);
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
})
|
||||
|
|
|
@ -58,15 +58,15 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
}
|
||||
});
|
||||
|
||||
const doDeletion = () => {
|
||||
const doDeletion = async () => {
|
||||
clearFlashes('files');
|
||||
|
||||
// For UI speed, immediately remove the file from the listing before calling the deletion function.
|
||||
// If the delete actually fails, we'll fetch the current directory contents again automatically.
|
||||
mutate(files => files!.filter(f => f.key !== file.key), false);
|
||||
await mutate(files => files!.filter(f => f.key !== file.key), false);
|
||||
|
||||
deleteFiles(uuid, directory, [ file.name ]).catch(error => {
|
||||
mutate();
|
||||
deleteFiles(uuid, directory, [ file.name ]).catch(async (error) => {
|
||||
await mutate();
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
});
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
copyFile(uuid, join(directory, file.name))
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
@ -99,7 +99,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
compressFiles(uuid, directory, [ file.name ])
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
decompressFiles(uuid, directory, file.name)
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
|
|
@ -50,12 +50,12 @@ const MassActionsBar = () => {
|
|||
setLoadingMessage('Deleting files...');
|
||||
|
||||
deleteFiles(uuid, directory, selectedFiles)
|
||||
.then(() => {
|
||||
mutate(files => files!.filter(f => selectedFiles.indexOf(f.name) < 0), false);
|
||||
.then(async () => {
|
||||
await mutate(files => files!.filter(f => selectedFiles.indexOf(f.name) < 0), false);
|
||||
setSelectedFiles([]);
|
||||
})
|
||||
.catch(error => {
|
||||
mutate();
|
||||
.catch(async (error) => {
|
||||
await mutate();
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
})
|
||||
.then(() => setLoading(false));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue