mirror of
https://github.com/mue/mue.git
synced 2026-07-16 21:44:22 +02:00
fix: continue conversion of settings system
This commit is contained in:
@@ -46,15 +46,6 @@ const Overview = () => {
|
||||
'message',
|
||||
],
|
||||
);
|
||||
const [news, setNews] = useState({
|
||||
title: '',
|
||||
date: '',
|
||||
description: '',
|
||||
link: '',
|
||||
linkText: '',
|
||||
});
|
||||
const [newsDone, setNewsDone] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
const arrayMove = (array, oldIndex, newIndex) => {
|
||||
const result = Array.from(array);
|
||||
@@ -102,30 +93,6 @@ const Overview = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const getNews = useCallback(async () => {
|
||||
try {
|
||||
const response = await fetch(`${variables.constants.API_URL}/news`);
|
||||
const data = await response.json();
|
||||
data.date = new window.Date(data.date).toLocaleDateString(
|
||||
variables.languagecode.replace('_', '-'),
|
||||
{
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
},
|
||||
);
|
||||
setNews(data);
|
||||
setNewsDone(true);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch news:', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
getNews();
|
||||
}, [getNews]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('order', JSON.stringify(items));
|
||||
|
||||
Reference in New Issue
Block a user