Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaiir committed Nov 23, 2023
1 parent e00d49d commit 3017a1a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useRef } from 'preact/hooks';
import useOptionsAsync, { LOAD_STATES } from '../../hooks/useOptionsAsync';
import useRestrictedMultiSelectValues from '../../hooks/useRestrictedMultiSelectValues';
import useCleanupMultiSelectValues from '../../hooks/useCleanupMultiSelectValues';
import classNames from 'classnames';
import { FormContext } from '../../context';

Expand Down Expand Up @@ -81,7 +81,7 @@ export default function Checklist(props) {
options
} = useOptionsAsync(field);

useRestrictedMultiSelectValues({
useCleanupMultiSelectValues({
field,
loadState,
options,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useRef } from 'preact/hooks';
import useOptionsAsync, { LOAD_STATES } from '../../hooks/useOptionsAsync';
import useRestrictedSingleSelectValue from '../../hooks/useRestrictedSingleSelectValue';
import useCleanupSingleSelectValue from '../../hooks/useCleanupSingleSelectValue';
import classNames from 'classnames';
import { FormContext } from '../../context';

Expand Down Expand Up @@ -70,7 +70,7 @@ export default function Radio(props) {
options
} = useOptionsAsync(field);

useRestrictedSingleSelectValue({
useCleanupSingleSelectValue({
field,
loadState,
options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext, useMemo, useRef, useState } from 'preact/hooks';

import { useService } from '../../hooks';
import useOptionsAsync, { LOAD_STATES } from '../../hooks/useOptionsAsync';
import useRestrictedMultiSelectValues from '../../hooks/useRestrictedMultiSelectValues';
import useCleanupMultiSelectValues from '../../hooks/useCleanupMultiSelectValues';

import { FormContext } from '../../context';
import classNames from 'classnames';
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function Taglist(props) {
options
} = useOptionsAsync(field);

useRestrictedMultiSelectValues({
useCleanupMultiSelectValues({
field,
loadState,
options,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'preact/hooks';
import useOptionsAsync, { LOAD_STATES } from '../../../hooks/useOptionsAsync';
import { useService } from '../../../hooks';
import useRestrictedSingleSelectValue from '../../../hooks/useRestrictedSingleSelectValue';
import useCleanupSingleSelectValue from '../../../hooks/useCleanupSingleSelectValue';

import { FormContext } from '../../../context';

Expand Down Expand Up @@ -42,7 +42,7 @@ export default function SearchableSelect(props) {
options
} = useOptionsAsync(field);

useRestrictedSingleSelectValue({
useCleanupSingleSelectValue({
field,
loadState,
options,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useContext, useMemo, useRef, useState } from 'preact/hooks';
import useOptionsAsync, { LOAD_STATES } from '../../../hooks/useOptionsAsync';
import useRestrictedSingleSelectValue from '../../../hooks/useRestrictedSingleSelectValue';
import useCleanupSingleSelectValue from '../../../hooks/useCleanupSingleSelectValue';

import { FormContext } from '../../../context';

Expand Down Expand Up @@ -39,7 +39,7 @@ export default function SimpleSelect(props) {
options
} = useOptionsAsync(field);

useRestrictedSingleSelectValue({
useCleanupSingleSelectValue({
field,
loadState,
options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function(props) {
values
} = props;

// Ensures that the values are always a subset of the options
// Ensures that the values are always a subset of the possible options
useEffect(() => {

if (loadState !== LOAD_STATES.LOADED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function(props) {
value
} = props;

// Ensures that the value is always one of the possible options
useEffect(() => {

if (loadState !== LOAD_STATES.LOADED) {
Expand Down

0 comments on commit 3017a1a

Please sign in to comment.