Merge remote-tracking branch 'soapbox/develop' into lexical
This commit is contained in:
commit
206a8d40e0
|
@ -6,7 +6,7 @@ interface IToggle extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'id'
|
|||
}
|
||||
|
||||
/** A glorified checkbox. */
|
||||
const Toggle: React.FC<IToggle> = ({ id, size = 'md', name, checked, onChange, required, disabled }) => {
|
||||
const Toggle: React.FC<IToggle> = ({ id, size = 'md', name, checked = false, onChange, required, disabled }) => {
|
||||
const input = useRef<HTMLInputElement>(null);
|
||||
|
||||
const handleClick: React.MouseEventHandler<HTMLButtonElement> = () => {
|
||||
|
|
|
@ -41,7 +41,7 @@ export const HashtagTimeline: React.FC<IHashtagTimeline> = ({ params }) => {
|
|||
useEffect(() => {
|
||||
dispatch(expandHashtagTimeline(id));
|
||||
dispatch(fetchHashtag(id));
|
||||
}, []);
|
||||
}, [id]);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(clearTimeline(`hashtag:${id}`));
|
||||
|
|
|
@ -62,7 +62,7 @@ const ProfilePage: React.FC<IProfilePage> = ({ params, children }) => {
|
|||
|
||||
if (account) {
|
||||
const ownAccount = account.id === me;
|
||||
if (ownAccount || account.pleroma?.hide_favorites !== true) {
|
||||
if (ownAccount || account.pleroma?.hide_favorites === false) {
|
||||
tabItems.push({
|
||||
text: <FormattedMessage id='navigation_bar.favourites' defaultMessage='Likes' />,
|
||||
to: `/@${account.acct}/favorites`,
|
||||
|
|
|
@ -145,8 +145,7 @@ const minifyReport = (report: AdminReportRecord): ReducerAdminReport => {
|
|||
target_account: normalizeId(report.getIn(['target_account', 'id'])),
|
||||
action_taken_by_account: normalizeId(report.getIn(['action_taken_by_account', 'id'])),
|
||||
assigned_account: normalizeId(report.getIn(['assigned_account', 'id'])),
|
||||
|
||||
statuses: report.get('statuses').map((status: any) => normalizeId(status.id)),
|
||||
statuses: report.get('statuses').map((status: any) => normalizeId(status.get('id'))),
|
||||
}) as ReducerAdminReport;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ export default function listAdderReducer(state: State = ReducerRecord(), action:
|
|||
return ReducerRecord();
|
||||
case LIST_ADDER_SETUP:
|
||||
return state.withMutations(map => {
|
||||
map.set('accountId', action.account.get('id'));
|
||||
map.set('accountId', action.account.id);
|
||||
});
|
||||
case LIST_ADDER_LISTS_FETCH_REQUEST:
|
||||
return state.setIn(['lists', 'isLoading'], true);
|
||||
|
|
|
@ -10,7 +10,7 @@ export const makeEmojiMap = (emojis: any) => emojis.reduce((obj: any, emoji: any
|
|||
|
||||
/** Normalize entity ID */
|
||||
export const normalizeId = (id: any): string | null => {
|
||||
return typeof id === 'string' ? id : null;
|
||||
return z.string().nullable().catch(null).parse(id);
|
||||
};
|
||||
|
||||
export type Normalizer<V, R> = (value: V) => R;
|
||||
|
|
Loading…
Reference in New Issue