fix: edit info reset after date change
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { FunctionComponent } from "preact";
|
||||
import { ErrorBoundary, lazy, LocationProvider, Route, Router, useLocation } from "preact-iso";
|
||||
import "preact/debug";
|
||||
import { ru } from "primelocale/js/ru.js";
|
||||
import { addLocale, locale, PrimeReactProvider } from "primereact/api";
|
||||
import { useMountEffect } from "primereact/hooks";
|
||||
@@ -26,8 +25,6 @@ export function App() {
|
||||
<PrimeReactProvider
|
||||
value={{
|
||||
unstyled: true,
|
||||
// pt: Tailwind,
|
||||
// ptOptions: { mergeProps: true, mergeSections: true, classNameMergeFunction: cn },
|
||||
}}
|
||||
>
|
||||
<LocationProvider>
|
||||
|
||||
@@ -100,9 +100,6 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
if (editContent) reset({ ...editContent, date: editContent.date.toISOString().slice(0, 16) });
|
||||
else reset();
|
||||
}, [editContent]);
|
||||
useEffect(() => {
|
||||
if (calendarDate && editContent) setEditContent({ ...editContent, date: calendarDate });
|
||||
}, [calendarDate]);
|
||||
useEffect(() => {
|
||||
reset({
|
||||
name: "",
|
||||
@@ -214,7 +211,7 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
year: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
}).format(editContent.date)}
|
||||
}).format(calendarDate!)}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex h-full flex-col items-start gap-1 rounded-2xl bg-[rgba(251,194,199,0.38)] px-4 py-2">
|
||||
|
||||
Reference in New Issue
Block a user