Leave admin menu up while choosing files
This commit is contained in:
parent
2e0767ce73
commit
8a9cd17cd5
@ -51,7 +51,13 @@ export default function AdminAppMenu({
|
||||
size={15}
|
||||
className="translate-x-[0.5px] translate-y-[0.5px]"
|
||||
/>,
|
||||
action: startUpload,
|
||||
action: () => new Promise(resolve => {
|
||||
if (startUpload) {
|
||||
startUpload(() => resolve());
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}),
|
||||
}, {
|
||||
label: 'Manage Photos',
|
||||
...photosCountTotal && {
|
||||
|
||||
@ -23,7 +23,7 @@ export interface AppStateContext {
|
||||
shouldRespondToKeyboardCommands?: boolean
|
||||
setShouldRespondToKeyboardCommands?: Dispatch<SetStateAction<boolean>>
|
||||
// UPLOAD
|
||||
startUpload?: () => void
|
||||
startUpload?: (onStart?: () => void) => void
|
||||
uploadInputRef?: RefObject<HTMLInputElement | null>
|
||||
uploadState: UploadState
|
||||
setUploadState?: (uploadState: Partial<UploadState>) => void
|
||||
|
||||
@ -90,10 +90,11 @@ export default function AppStateProvider({
|
||||
const [shouldDebugRecipeOverlays, setShouldDebugRecipeOverlays] =
|
||||
useState(false);
|
||||
|
||||
const startUpload = useCallback(() => {
|
||||
const startUpload = useCallback((onStart?: () => void) => {
|
||||
if (uploadInputRef.current) {
|
||||
uploadInputRef.current.value = '';
|
||||
uploadInputRef.current.click();
|
||||
uploadInputRef.current.oninput = onStart ?? null;
|
||||
}
|
||||
}, []);
|
||||
const setUploadState = useCallback((uploadState: Partial<UploadState>) => {
|
||||
@ -125,6 +126,8 @@ export default function AppStateProvider({
|
||||
},
|
||||
);
|
||||
|
||||
console.log('adminData', adminData);
|
||||
|
||||
useEffect(() => {
|
||||
if (userEmail) {
|
||||
storeAuthEmailCookie(userEmail);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user