Add support for storing SSH keys on user accounts

This commit is contained in:
DaneEveritt 2022-05-14 17:31:53 -04:00
parent 5705d7dbdd
commit 97280a62a2
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
20 changed files with 678 additions and 6 deletions

View file

@ -2,8 +2,23 @@ import { Actions, useStoreActions } from 'easy-peasy';
import { FlashStore } from '@/state/flashes';
import { ApplicationStore } from '@/state';
interface KeyedFlashStore {
clearFlashes: () => void;
clearAndAddHttpError: (error?: Error | string | null) => void;
}
const useFlash = (): Actions<FlashStore> => {
return useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
};
const useFlashKey = (key: string): KeyedFlashStore => {
const { clearFlashes, clearAndAddHttpError } = useFlash();
return {
clearFlashes: () => clearFlashes(key),
clearAndAddHttpError: (error) => clearAndAddHttpError({ key, error }),
};
};
export { useFlashKey };
export default useFlash;