fix: improve note interactions and markdown LaTeX support
## Bug Fixes ### Note Card Actions - Fix broken size change functionality (missing state declaration) - Implement React 19 useOptimistic for instant UI feedback - Add startTransition for non-blocking updates - Ensure smooth animations without page refresh - All note actions now work: pin, archive, color, size, checklist ### Markdown LaTeX Rendering - Add remark-math and rehype-katex plugins - Support inline equations with dollar sign syntax - Support block equations with double dollar sign syntax - Import KaTeX CSS for proper styling - Equations now render correctly instead of showing raw LaTeX ## Technical Details - Replace undefined currentNote references with optimistic state - Add optimistic updates before server actions for instant feedback - Use router.refresh() in transitions for smart cache invalidation - Install remark-math, rehype-katex, and katex packages ## Testing - Build passes successfully with no TypeScript errors - Dev server hot-reloads changes correctly
This commit is contained in:
35
keep-notes/scripts/promote-admin.js
Normal file
35
keep-notes/scripts/promote-admin.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const { PrismaClient } = require('../prisma/client-generated');
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function promoteAdmin() {
|
||||
const email = process.argv[2];
|
||||
|
||||
try {
|
||||
let user;
|
||||
if (email) {
|
||||
user = await prisma.user.findUnique({ where: { email } });
|
||||
} else {
|
||||
console.log("Aucun email fourni, promotion du premier utilisateur trouvé...");
|
||||
user = await prisma.user.findFirst();
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
console.error("Aucun utilisateur trouvé.");
|
||||
return;
|
||||
}
|
||||
|
||||
await prisma.user.update({
|
||||
where: { id: user.id },
|
||||
data: { role: 'ADMIN' }
|
||||
});
|
||||
|
||||
console.log(`Succès : L'utilisateur ${user.email} (${user.name}) est maintenant ADMIN.`);
|
||||
|
||||
} catch (e) {
|
||||
console.error("Erreur :", e);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
promoteAdmin();
|
||||
Reference in New Issue
Block a user