Compare commits

...

4 Commits

2 changed files with 6 additions and 5 deletions

View File

@ -236,9 +236,9 @@ function AppPage({ title, onBack }: { title: string; onBack: () => void }) {
<div className="size-full flex flex-col bg-neutral-50"> <div className="size-full flex flex-col bg-neutral-50">
<Toaster <Toaster
position="bottom-center" position="bottom-center"
offset="calc(4rem + env(safe-area-inset-bottom))" offset="calc(4.5rem + env(safe-area-inset-bottom))"
richColors richColors
closeButton expand
duration={5000} duration={5000}
toastOptions={{ toastOptions={{
style: { fontSize: '0.9rem', fontWeight: 500, padding: '14px 16px' }, style: { fontSize: '0.9rem', fontWeight: 500, padding: '14px 16px' },

View File

@ -492,6 +492,7 @@ export default function MediaManager({ initialPath, rootPath, title, config, set
useEffect(() => { useEffect(() => {
let cancelled = false; let cancelled = false;
setFolderConfig(null);
getFileContents(joinPath(path, '.config')) getFileContents(joinPath(path, '.config'))
.then(async blob => { .then(async blob => {
if (cancelled) return; if (cancelled) return;
@ -903,7 +904,7 @@ export default function MediaManager({ initialPath, rootPath, title, config, set
await createFolder(joinPath(path, name), true); await createFolder(joinPath(path, name), true);
toast.success(`Created folder "${name}"`); toast.success(`Created folder "${name}"`);
setShowNewFolder(false); setNewFolderName(''); setShowNewFolder(false); setNewFolderName('');
void load(joinPath(path, name)); navigateTo(joinPath(path, name));
} catch (e: any) { toast.error(`Failed to create folder: ${e?.message ?? e}`); } } catch (e: any) { toast.error(`Failed to create folder: ${e?.message ?? e}`); }
}; };
@ -1045,14 +1046,14 @@ export default function MediaManager({ initialPath, rootPath, title, config, set
})} })}
</div> </div>
{folderConfig !== null && ( {folderConfig !== null && (
<button onClick={() => void handleConfigureFolder()} className="p-1 rounded hover:bg-green-100 text-green-500 flex-shrink-0" title="Folder has .config — click to edit"> <button onClick={() => void handleConfigureFolder()} className="p-1 rounded hover:bg-green-100 text-green-500 flex-shrink-0" title="Edit Folder Config">
<SlidersHorizontal className="w-3.5 h-3.5" strokeWidth={3} /> <SlidersHorizontal className="w-3.5 h-3.5" strokeWidth={3} />
</button> </button>
)} )}
</div> </div>
{(folderConfig?.['base_url']) && ( {(folderConfig?.['base_url']) && (
<div className="text-xs text-neutral-400 mt-0.5 truncate"> <div className="text-xs text-neutral-400 mt-0.5 truncate">
Base: {folderConfig?.['base_url']} {folderConfig?.['base_url']}
</div> </div>
)} )}