Show an error if a user attempts to upload a folder
This commit is contained in:
parent
1d5d92f678
commit
1cfa4100ad
2 changed files with 27 additions and 39 deletions
|
@ -3,6 +3,7 @@ import { FlashStore } from '@/state/flashes';
|
|||
import { ApplicationStore } from '@/state';
|
||||
|
||||
interface KeyedFlashStore {
|
||||
addError: (message: string, title?: string) => void;
|
||||
clearFlashes: () => void;
|
||||
clearAndAddHttpError: (error?: Error | string | null) => void;
|
||||
}
|
||||
|
@ -12,9 +13,10 @@ const useFlash = (): Actions<FlashStore> => {
|
|||
};
|
||||
|
||||
const useFlashKey = (key: string): KeyedFlashStore => {
|
||||
const { clearFlashes, clearAndAddHttpError } = useFlash();
|
||||
const { addFlash, clearFlashes, clearAndAddHttpError } = useFlash();
|
||||
|
||||
return {
|
||||
addError: (message, title) => addFlash({ key, message, title, type: 'error' }),
|
||||
clearFlashes: () => clearFlashes(key),
|
||||
clearAndAddHttpError: (error) => clearAndAddHttpError({ key, error }),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue