mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 06:59:09 +00:00
chore: rename blocks to groups
This commit is contained in:
committed by
Carlos Valente
parent
486d89ecf4
commit
e5d2457717
@@ -12,8 +12,8 @@ interface EventSelectionStore {
|
||||
selectedEvents: Set<EntryId>;
|
||||
anchoredIndex: MaybeNumber;
|
||||
cursor: MaybeString;
|
||||
entryMode: 'event' | 'block' | null;
|
||||
setSelectedBlock: (selectionArgs: { id: EntryId }) => void;
|
||||
entryMode: 'event' | 'single' | null;
|
||||
setSingleEntrySelection: (selectionArgs: { id: EntryId }) => void;
|
||||
setSelectedEvents: (selectionArgs: { id: EntryId; index: number; selectMode: SelectionMode }) => void;
|
||||
clearSelectedEvents: () => void;
|
||||
clearMultiSelect: () => void;
|
||||
@@ -25,14 +25,14 @@ export const useEventSelection = create<EventSelectionStore>()((set, get) => ({
|
||||
anchoredIndex: null,
|
||||
cursor: null,
|
||||
entryMode: null,
|
||||
setSelectedBlock: ({ id }) => {
|
||||
set({ selectedEvents: new Set([id]), anchoredIndex: null, cursor: id, entryMode: 'block' });
|
||||
setSingleEntrySelection: ({ id }) => {
|
||||
set({ selectedEvents: new Set([id]), anchoredIndex: null, cursor: id, entryMode: 'single' });
|
||||
},
|
||||
setSelectedEvents: ({ id, index, selectMode }) => {
|
||||
const { selectedEvents, anchoredIndex, entryMode } = get();
|
||||
|
||||
// if we are in block mode, we replace the selection and change the mode
|
||||
if (entryMode === 'block') {
|
||||
// if we are in single mode, we replace the selection and change the mode
|
||||
if (entryMode === 'single') {
|
||||
return set({ selectedEvents: new Set([id]), anchoredIndex: index, cursor: id, entryMode: 'event' });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user