diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -85,7 +85,10 @@ SubscriptionUpdateRequest, SubscriptionUpdateResult, } from '../types/subscription-types.js'; -import { thickThreadTypes } from '../types/thread-types-enum.js'; +import { + thickThreadTypes, + threadTypeIsThick, +} from '../types/thread-types-enum.js'; import type { RawThreadInfos } from '../types/thread-types.js'; import { userActionsP2PMessageTypes, @@ -1299,17 +1302,10 @@ }; }; -type UseUpdateSubscriptionInput = $ReadOnly< - | { - +thick: false, - ...SubscriptionUpdateRequest, - } - | { - +thick: true, - +threadInfo: ThreadInfo, - ...SubscriptionUpdateRequest, - }, ->; +type UseUpdateSubscriptionInput = $ReadOnly<{ + +threadInfo: ThreadInfo, + ...SubscriptionUpdateRequest, +}>; function useUpdateSubscription(): ( input: UseUpdateSubscriptionInput, ) => Promise { @@ -1321,8 +1317,8 @@ return React.useCallback( async (input: UseUpdateSubscriptionInput) => { - if (!input.thick) { - const { thick, ...rest } = input; + if (!threadTypeIsThick(input.threadInfo.type)) { + const { threadInfo, ...rest } = input; return await keyserverCall({ ...rest }); } diff --git a/lib/shared/thread-settings-notifications-utils.js b/lib/shared/thread-settings-notifications-utils.js --- a/lib/shared/thread-settings-notifications-utils.js +++ b/lib/shared/thread-settings-notifications-utils.js @@ -11,7 +11,6 @@ import { createLoadingStatusSelector } from '../selectors/loading-selectors.js'; import { threadInfoSelector } from '../selectors/thread-selectors.js'; import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; -import { threadTypeIsThick } from '../types/thread-types-enum.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; import { useSelector } from '../utils/redux-utils.js'; @@ -87,16 +86,10 @@ pushNotifs: notificationSettings === 'home', }, }; - const updateSubscriptionInput = threadTypeIsThick(threadInfo.type) - ? { - thick: true, - threadInfo, - ...updateSubscriptionRequest, - } - : { - thick: false, - ...updateSubscriptionRequest, - }; + const updateSubscriptionInput = { + threadInfo, + ...updateSubscriptionRequest, + }; const res = await callUpdateSubscription(updateSubscriptionInput);