fix: disable mobile drag, replace window.location.reload with router.refresh, use semantic icons

- Disable Muuri drag on mobile devices to prevent scroll conflicts
- Replace all remaining window.location.reload() with router.refresh() in settings/data, settings/general, and note-editor
- Replace duplicate X icons with semantic icons (Trash2 for fused badge, LogOut for leave share)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Sepehr Ramezani
2026-04-01 21:34:22 +02:00
parent 8f35bac56f
commit 377f0c739f
5 changed files with 13 additions and 10 deletions

View File

@@ -6,9 +6,11 @@ import { Button } from '@/components/ui/button'
import { Download, Upload, Trash2, Loader2 } from 'lucide-react'
import { toast } from 'sonner'
import { useLanguage } from '@/lib/i18n'
import { useRouter } from 'next/navigation'
export default function DataSettingsPage() {
const { t } = useLanguage()
const router = useRouter()
const [isExporting, setIsExporting] = useState(false)
const [isImporting, setIsImporting] = useState(false)
const [isDeleting, setIsDeleting] = useState(false)
@@ -54,7 +56,7 @@ export default function DataSettingsPage() {
if (response.ok) {
const result = await response.json()
toast.success(t('dataManagement.import.success', { count: result.count }))
window.location.reload()
router.refresh()
} else {
throw new Error('Import failed')
}
@@ -77,7 +79,7 @@ export default function DataSettingsPage() {
const response = await fetch('/api/notes/delete-all', { method: 'POST' })
if (response.ok) {
toast.success(t('dataManagement.delete.success'))
window.location.reload()
router.refresh()
}
} catch (error) {
console.error('Delete error:', error)