mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
fix share date setting, notification, lint fix
This commit is contained in:
parent
53499e2579
commit
c21f7df7b2
3 changed files with 10 additions and 9 deletions
|
|
@ -846,12 +846,12 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => {
|
|||
rightIcon: (
|
||||
<Group ref={setRatingsRef as any}>
|
||||
<Rating
|
||||
value={rating}
|
||||
onChange={(e) => {
|
||||
handleUpdateRating(e);
|
||||
setRating(e);
|
||||
}}
|
||||
size="xs"
|
||||
value={rating}
|
||||
/>
|
||||
</Group>
|
||||
),
|
||||
|
|
@ -891,6 +891,7 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => {
|
|||
handleOpenItemDetails,
|
||||
handlePlay,
|
||||
handleUpdateRating,
|
||||
rating,
|
||||
]);
|
||||
|
||||
const mergedRef = useMergedRef(ref, clickOutsideRef);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { useForm } from '@mantine/form';
|
||||
import { closeModal, ContextModalProps } from '@mantine/modals';
|
||||
import dayjs from 'dayjs';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useShareItem } from '/@/renderer/features/sharing/mutations/share-item-mutation';
|
||||
|
|
@ -26,8 +27,7 @@ export const ShareItemContextModal = ({
|
|||
const shareItemMutation = useShareItem({});
|
||||
|
||||
// Uses the same default as Navidrome: 1 year
|
||||
const defaultDate = new Date();
|
||||
defaultDate.setFullYear(defaultDate.getFullYear() + 1);
|
||||
const defaultDate = dayjs().add(1, 'year').format('YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
const form = useForm({
|
||||
initialValues: {
|
||||
|
|
@ -37,7 +37,7 @@ export const ShareItemContextModal = ({
|
|||
},
|
||||
validate: {
|
||||
expires: (value) =>
|
||||
value > new Date()
|
||||
dayjs(value).isAfter(dayjs())
|
||||
? null
|
||||
: t('form.shareItem.expireInvalid', {
|
||||
postProcess: 'sentenceCase',
|
||||
|
|
@ -51,7 +51,7 @@ export const ShareItemContextModal = ({
|
|||
body: {
|
||||
description: values.description,
|
||||
downloadable: values.allowDownloading,
|
||||
expires: values.expires.getTime(),
|
||||
expires: dayjs(values.expires).valueOf(),
|
||||
resourceIds: itemIds.join(),
|
||||
resourceType,
|
||||
},
|
||||
|
|
@ -105,7 +105,7 @@ export const ShareItemContextModal = ({
|
|||
postProcess: 'titleCase',
|
||||
})}
|
||||
minDate={new Date()}
|
||||
placeholder={defaultDate.toLocaleDateString()}
|
||||
placeholder={defaultDate}
|
||||
popoverProps={{ withinPortal: true }}
|
||||
valueFormat="MM/DD/YYYY HH:mm"
|
||||
{...form.getInputProps('expires')}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue