]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/episodes/RestreamAddForm.js
improved user context
[alttp.git] / resources / js / components / episodes / RestreamAddForm.js
index 7cbb87d538e17b2102ebe95df68edfe9c78bba23..c09b92b8d817125369f79dc2b386492becdc8d62 100644 (file)
@@ -7,7 +7,9 @@ import { useTranslation } from 'react-i18next';
 import DialogEpisode from './DialogEpisode';
 import ToggleSwitch from '../common/ToggleSwitch';
 import laravelErrorsToFormik from '../../helpers/laravelErrorsToFormik';
-import { withUser } from '../../helpers/UserContext';
+import { withUser } from '../../hooks/user';
+
+const channelCompare = (a, b) => a.channel.title.localeCompare(b.channel.title);
 
 const RestreamAddForm = ({
        episode,
@@ -35,7 +37,7 @@ const RestreamAddForm = ({
                                        value={values.channel_id || 0}
                                >
                                        <option disabled value={0}>{t('general.pleaseSelect')}</option>
-                                       {((user && user.channel_crews) || []).map(c =>
+                                       {((user && user.channel_crews) || []).sort(channelCompare).map(c =>
                                                <option key={c.id} value={c.channel_id}>
                                                        {c.channel.title}
                                                </option>