mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
refactor: small code improvements
This commit is contained in:
committed by
Carlos Valente
parent
e5d2457717
commit
9ab6b30aea
@@ -160,7 +160,7 @@ export function makeSortableList(order: EntryId[], entries: RundownEntries): Ent
|
||||
* Checks whether a drop operation is valid
|
||||
* Currently only used for validating dropping groups
|
||||
*/
|
||||
export function canDrop(targetType?: SupportedEntry & 'end-group', targetParent?: EntryId | null): boolean {
|
||||
export function canDrop(targetType?: SupportedEntry | 'end-group', targetParent?: EntryId | null): boolean {
|
||||
// this would mean inserting a group inside another
|
||||
if (targetType === 'end-group') {
|
||||
return false;
|
||||
|
||||
@@ -103,7 +103,11 @@ export const useEventSelection = create<EventSelectionStore>()((set, get) => ({
|
||||
clearMultiSelect: () => {
|
||||
const { selectedEvents } = get();
|
||||
const [firstSelected] = selectedEvents;
|
||||
set({ selectedEvents: new Set(firstSelected || undefined), anchoredIndex: null, entryMode: null });
|
||||
set({
|
||||
selectedEvents: new Set(firstSelected ? [firstSelected] : []),
|
||||
anchoredIndex: null,
|
||||
entryMode: null,
|
||||
});
|
||||
},
|
||||
unselect: (id: string) => {
|
||||
const { entryMode, selectedEvents } = get();
|
||||
|
||||
Reference in New Issue
Block a user