mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-07-05 04:45:31 +01:00
Add reason strings to noop actions
Co-authored-by: Jamie <113370520+jamiebuilds-signal@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import type { ServiceIdString } from '../../types/ServiceId.std.ts';
|
||||
import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s.dom.ts';
|
||||
import { useBoundActions } from '../../hooks/useBoundActions.std.ts';
|
||||
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
|
||||
const log = createLogger('accounts');
|
||||
|
||||
@@ -76,10 +76,7 @@ function checkForAccount(
|
||||
phoneNumber
|
||||
);
|
||||
if (existing) {
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('checkForAccount'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ import {
|
||||
} from '../../textsecure/WebAPI.preload.ts';
|
||||
import { itemStorage } from '../../textsecure/Storage.preload.ts';
|
||||
import type { SizeCallbackType } from '../../calling/VideoSupport.preload.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { SignalService } from '../../protobuf/index.std.ts';
|
||||
|
||||
const { omit } = lodash;
|
||||
@@ -1298,10 +1298,7 @@ function sendRemoteMute(
|
||||
}
|
||||
|
||||
calling.sendRemoteMute(activeCall.conversationId, demuxId);
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('sendRemoteMute'));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import type {
|
||||
PinMessageData,
|
||||
ReadonlyMessageAttributesType,
|
||||
} from '../../model-types.d.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { ShowToastActionType } from './toast.preload.ts';
|
||||
import type { StateType as RootStateType } from '../reducer.preload.ts';
|
||||
import { createLogger } from '../../logging/log.std.ts';
|
||||
@@ -332,10 +332,7 @@ function onClearAttachments(conversationId: string): NoopActionType {
|
||||
conversation.get('draftAttachments')
|
||||
);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('onClearAttachments');
|
||||
}
|
||||
|
||||
function cancelJoinRequest(conversationId: string): NoopActionType {
|
||||
@@ -350,20 +347,14 @@ function cancelJoinRequest(conversationId: string): NoopActionType {
|
||||
task: async () => conversation.cancelJoinRequest(),
|
||||
});
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('cancelJoinRequest');
|
||||
}
|
||||
|
||||
function onCloseLinkPreview(conversationId: string): NoopActionType {
|
||||
suspendLinkPreviews();
|
||||
removeLinkPreview(conversationId);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('onCloseLinkPreview');
|
||||
}
|
||||
|
||||
function onTextTooLong(): ShowToastActionType {
|
||||
@@ -806,10 +797,7 @@ function sendStickerMessage(
|
||||
log.error('clickSend error:', Errors.toLogFormat(error));
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('sendStickerMessage'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -855,10 +843,7 @@ function sendPoll(
|
||||
log.error('sendPoll error:', Errors.toLogFormat(error));
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('sendPoll'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1156,10 +1141,7 @@ function onEditorStateChange({
|
||||
conversationId,
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('onEditorStateChange'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1283,10 +1265,7 @@ function processAttachments({
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('processAttachments'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1467,10 +1446,7 @@ function reactToMessage(
|
||||
emoji,
|
||||
remove,
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('reactToMessage'));
|
||||
} catch (error) {
|
||||
log.error(
|
||||
'reactToMessage: Error sending reaction',
|
||||
@@ -1499,10 +1475,7 @@ function endPoll(
|
||||
return async dispatch => {
|
||||
try {
|
||||
await enqueuePollTerminateForSend({ messageId });
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('endPoll'));
|
||||
} catch (error) {
|
||||
log.error('endPoll: Error sending poll terminate', error, messageId);
|
||||
dispatch({
|
||||
|
||||
@@ -121,7 +121,7 @@ import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUp
|
||||
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts';
|
||||
import { useBoundActions } from '../../hooks/useBoundActions.std.ts';
|
||||
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import {
|
||||
conversationJobQueue,
|
||||
conversationQueueJobEnum,
|
||||
@@ -1389,10 +1389,7 @@ function acknowledgeGroupMemberNameCollisions(
|
||||
|
||||
conversation.acknowledgeGroupMemberNameCollisions(groupNameCollisions);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('acknowledgeGroupMemberNameCollisions');
|
||||
}
|
||||
function blockGroupLinkRequests(
|
||||
conversationId: string,
|
||||
@@ -1405,10 +1402,7 @@ function blockGroupLinkRequests(
|
||||
|
||||
void conversation.blockGroupLinkRequests(serviceId);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('blockGroupLinkRequests');
|
||||
}
|
||||
function loadNewerMessages(
|
||||
conversationId: string,
|
||||
@@ -1421,10 +1415,7 @@ function loadNewerMessages(
|
||||
|
||||
void conversation.loadNewerMessages(newestMessageId);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('loadNewerMessages');
|
||||
}
|
||||
function loadNewestMessages(
|
||||
conversationId: string,
|
||||
@@ -1438,10 +1429,7 @@ function loadNewestMessages(
|
||||
|
||||
void conversation.loadNewestMessages(newestMessageId, setFocus);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('loadNewestMessages');
|
||||
}
|
||||
|
||||
function loadOlderMessages(
|
||||
@@ -1454,10 +1442,7 @@ function loadOlderMessages(
|
||||
}
|
||||
|
||||
void conversation.loadOlderMessages(oldestMessageId);
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('loadOlderMessages');
|
||||
}
|
||||
|
||||
function _getAllConversationsInChatFolder(
|
||||
@@ -1571,10 +1556,7 @@ function removeMember(
|
||||
task: () => conversation.removeFromGroupV2(memberConversationId),
|
||||
});
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('removeMember');
|
||||
}
|
||||
|
||||
function filterAvatarData(
|
||||
@@ -1665,10 +1647,7 @@ function changeHasGroupLink(
|
||||
idForLogging: conversation.idForLogging(),
|
||||
task: async () => conversation.toggleGroupLink(value),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('changeHasGroupLink'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1687,10 +1666,7 @@ function setAnnouncementsOnly(
|
||||
idForLogging: conversation.idForLogging(),
|
||||
task: async () => conversation.updateAnnouncementsOnly(value),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setAnnouncementsOnly'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1709,10 +1685,7 @@ function setAccessControlMembersSetting(
|
||||
idForLogging: conversation.idForLogging(),
|
||||
task: async () => conversation.updateAccessControlMembers(value),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setAccessControlMembersSetting'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1733,10 +1706,7 @@ function setAccessControlMemberLabelSetting(
|
||||
idForLogging: conversation.idForLogging(),
|
||||
task: async () => conversation.updateAccessControlMemberLabel(value),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setAccessControlMemberLabelSetting'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1757,10 +1727,7 @@ function setAccessControlAttributesSetting(
|
||||
idForLogging: conversation.idForLogging(),
|
||||
task: async () => conversation.updateAccessControlAttributes(value),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setAccessControlAttributesSetting'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1785,10 +1752,7 @@ function setDisappearingMessages(
|
||||
version: undefined,
|
||||
}),
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setDisappearingMessages'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1803,10 +1767,7 @@ function setDontNotifyForMentionsIfMuted(
|
||||
|
||||
conversation.setDontNotifyForMentionsIfMuted(newValue);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('setDontNotifyForMentionsIfMuted');
|
||||
}
|
||||
|
||||
function setChatFolderMuteExpiration(
|
||||
@@ -1840,10 +1801,7 @@ function setMuteExpiration(
|
||||
: Date.now() + muteExpiresAt
|
||||
);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('setMuteExpiration');
|
||||
}
|
||||
|
||||
function setPinned(
|
||||
@@ -1874,10 +1832,7 @@ function setPinned(
|
||||
conversation.unpin();
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('setPinned');
|
||||
}
|
||||
|
||||
function deleteMessages({
|
||||
@@ -2013,10 +1968,7 @@ function destroyMessages(
|
||||
},
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('destroyMessages'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2143,10 +2095,7 @@ function generateNewGroupLink(
|
||||
task: async () => conversation.refreshGroupLink(),
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('generateNewGroupLink'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2243,10 +2192,7 @@ function setAccessControlAddFromInviteLinkSetting(
|
||||
conversation.updateAccessControlAddFromInviteLink(value),
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('setAccessControlAddFromInviteLinkSetting'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2454,10 +2400,7 @@ function kickOffAttachmentDownload(
|
||||
drop(window.MessageCache.saveMessage(message.attributes));
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('kickOffAttachmentDownload'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2494,10 +2437,7 @@ function cancelAttachmentDownload({
|
||||
|
||||
await DataWriter.removeAttachmentDownloadJobsForMessage(messageId);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('cancelAttachmentDownload'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2512,10 +2452,7 @@ function markAttachmentAsCorrupted(
|
||||
return async dispatch => {
|
||||
await doMarkAttachmentAsCorrupted(options.messageId, options.attachment);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('markAttachmentAsCorrupted'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2640,10 +2577,7 @@ function retryMessageSend(
|
||||
);
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('retryMessageSend'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2662,10 +2596,7 @@ function sendPollVote({
|
||||
// TODO DESKTOP-9343: show toast on exception
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('sendPollVote'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2681,10 +2612,7 @@ export function copyMessageText(
|
||||
const body = getNotificationTextForMessage(message.attributes);
|
||||
clipboard.writeText(body);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('copyMessageText'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2735,10 +2663,7 @@ export function retryDeleteForEveryone(
|
||||
);
|
||||
await conversationJobQueue.add(jobData);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('retryDeleteForEveryone'));
|
||||
} catch (error) {
|
||||
log.error(
|
||||
'retryDeleteForEveryone: Failed to queue delete for everyone',
|
||||
@@ -3179,10 +3104,7 @@ function terminateGroup(
|
||||
);
|
||||
}
|
||||
} else {
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('terminateGroup'));
|
||||
}
|
||||
} catch {
|
||||
dispatch({
|
||||
@@ -3313,10 +3235,7 @@ function getProfilesForConversation(conversationId: string): NoopActionType {
|
||||
|
||||
drop(conversation.getProfiles());
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('getProfilesForConversation');
|
||||
}
|
||||
|
||||
function conversationStoppedByMissingVerification(payload: {
|
||||
@@ -3675,10 +3594,7 @@ function deleteMessagesForEveryone(
|
||||
},
|
||||
});
|
||||
} else {
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('deleteMessagesForEveryone'));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3740,10 +3656,7 @@ function approvePendingMembershipFromGroupV2(
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('approvePendingMembershipFromGroupV2'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3817,10 +3730,7 @@ function revokePendingMembershipsFromGroupV2(
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('revokePendingMembershipsFromGroupV2'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4067,10 +3977,7 @@ function acceptConversation(
|
||||
}
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('acceptConversation'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4146,10 +4053,7 @@ function blockConversation(
|
||||
}
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('blockConversation'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4184,10 +4088,7 @@ function deleteConversation(
|
||||
await conversation.destroyMessages({ source: 'local-delete' });
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('deleteConversation'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4205,10 +4106,7 @@ function initiateMigrationToGroupV2(conversationId: string): NoopActionType {
|
||||
task: () => doInitiateMigrationToGroupV2(conversation),
|
||||
});
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('initiateMigrationToGroupV2');
|
||||
}
|
||||
|
||||
export type SaveAttachmentActionCreatorType = ReadonlyDeep<
|
||||
@@ -4612,10 +4510,7 @@ function toggleHideStories(
|
||||
if (conversationModel) {
|
||||
conversationModel.toggleHideStories();
|
||||
}
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('toggleHideStories'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4633,10 +4528,7 @@ function removeMemberFromGroup(
|
||||
task: () => conversationModel.removeFromGroupV2(contactId),
|
||||
});
|
||||
}
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('removeMemberFromGroup'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4812,10 +4704,7 @@ function toggleGroupsForStorySend(
|
||||
})
|
||||
);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('toggleGroupsForStorySend'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4828,10 +4717,7 @@ function toggleAdmin(
|
||||
if (conversationModel) {
|
||||
void conversationModel.toggleAdmin(contactId);
|
||||
}
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('toggleAdmin'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5134,10 +5020,7 @@ function doubleCheckMissingQuoteReference(messageId: string): NoopActionType {
|
||||
drop(doDoubleCheckMissingQuoteReference(message));
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('doubleCheckMissingQuoteReference');
|
||||
}
|
||||
|
||||
function setPendingRequestedAvatarDownload(
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
} from '../../types/message/LinkPreviews.std.ts';
|
||||
import type { AttachmentForUIType } from '../../types/Attachment.std.ts';
|
||||
import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview.std.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { StateType as RootStateType } from '../reducer.preload.ts';
|
||||
import { LinkPreviewSourceType } from '../../types/LinkPreview.std.ts';
|
||||
import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.ts';
|
||||
@@ -62,10 +62,7 @@ function debouncedMaybeGrabLinkPreview(
|
||||
return dispatch => {
|
||||
maybeGrabLinkPreview(message, source, options);
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('debouncedMaybeGrabLinkPreview'));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
|
||||
export type NoopActionType = ReadonlyDeep<{
|
||||
type: 'NOOP';
|
||||
type: `NOOP/${string}`;
|
||||
payload: null;
|
||||
}>;
|
||||
|
||||
export function noopAction(): NoopActionType {
|
||||
export function noopAction(cause: string): NoopActionType {
|
||||
return {
|
||||
type: 'NOOP',
|
||||
type: `NOOP/${cause}`,
|
||||
payload: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import { trigger } from '../../shims/events.dom.ts';
|
||||
import { ERASE_STORAGE_SERVICE } from './user.preload.ts';
|
||||
import type { EraseStorageServiceStateAction } from './user.preload.ts';
|
||||
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts';
|
||||
import { useBoundActions } from '../../hooks/useBoundActions.std.ts';
|
||||
import { strictAssert } from '../../util/assert.std.ts';
|
||||
@@ -221,10 +221,7 @@ function downloadStickerPack(
|
||||
})
|
||||
);
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('downloadStickerPack');
|
||||
}
|
||||
|
||||
function installStickerPack(
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
MessagesAddedActionType,
|
||||
TargetedConversationChangedActionType,
|
||||
} from './conversations.preload.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { StateType as RootStateType } from '../reducer.preload.ts';
|
||||
import type {
|
||||
StoryViewTargetType,
|
||||
@@ -320,10 +320,7 @@ function deleteGroupStoryReplyForEveryone(
|
||||
|
||||
// the call above re-uses the sync-message processing code to update the UI
|
||||
// we don't need to do anything here
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('deleteGroupStoryReplyForEveryone'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -555,10 +552,7 @@ function queueStoryDownload(
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('queueStoryDownload'));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -578,10 +572,7 @@ function reactToStory(
|
||||
emoji: nextReaction,
|
||||
remove: false,
|
||||
});
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('reactToStory'));
|
||||
} catch (error) {
|
||||
log.error('Error enqueuing reaction', error, messageId, nextReaction);
|
||||
dispatch({
|
||||
@@ -1455,10 +1446,7 @@ function removeAllContactStories(
|
||||
|
||||
await DataWriter.removeMessagesById(messageIds, { cleanupMessages });
|
||||
|
||||
dispatch({
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
});
|
||||
dispatch(noopAction('removeAllContactStories'));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron';
|
||||
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import { useBoundActions } from '../../hooks/useBoundActions.std.ts';
|
||||
import type { AnyToast } from '../../types/Toast.dom.tsx';
|
||||
|
||||
@@ -48,10 +48,7 @@ function hideToast(toast?: AnyToast): HideToastActionType {
|
||||
|
||||
function openFileInFolder(target: string): NoopActionType {
|
||||
ipcRenderer.send('show-item-in-folder', target);
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('openFileInFolder');
|
||||
}
|
||||
|
||||
export type ShowToastAction = ReadonlyDeep<(toast: AnyToast) => void>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { trigger } from '../../shims/events.dom.ts';
|
||||
import type { LocaleMessagesType } from '../../types/I18N.std.ts';
|
||||
import type { LocalizerType } from '../../types/Util.std.ts';
|
||||
import type { MenuOptionsType } from '../../types/menu.std.ts';
|
||||
import type { NoopActionType } from './noop.std.ts';
|
||||
import { noopAction, type NoopActionType } from './noop.std.ts';
|
||||
import type { AciString, PniString } from '../../types/ServiceId.std.ts';
|
||||
import OS from '../../util/os/osMain.node.ts';
|
||||
import { ThemeType } from '../../types/Util.std.ts';
|
||||
@@ -106,10 +106,7 @@ function userChanged(attributes: {
|
||||
function manualReconnect(): NoopActionType {
|
||||
trigger('manualConnect');
|
||||
|
||||
return {
|
||||
type: 'NOOP',
|
||||
payload: null,
|
||||
};
|
||||
return noopAction('manualReconnect');
|
||||
}
|
||||
|
||||
const intlNotSetup = () => {
|
||||
|
||||
@@ -210,7 +210,7 @@ describe('calling duck', () => {
|
||||
const ourAci = generateAci();
|
||||
|
||||
const getEmptyRootState = (): StateType => {
|
||||
const rootState = rootReducer(undefined, noopAction());
|
||||
const rootState = rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
return {
|
||||
...rootState,
|
||||
user: {
|
||||
|
||||
@@ -123,7 +123,8 @@ describe('both/state/ducks/conversations', () => {
|
||||
const SERVICE_ID_3 = generateAci();
|
||||
const SERVICE_ID_4 = generateAci();
|
||||
|
||||
const getEmptyRootState = () => rootReducer(undefined, noopAction());
|
||||
const getEmptyRootState = () =>
|
||||
rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
|
||||
let sinonSandbox: sinon.SinonSandbox;
|
||||
let createGroupStub: sinon.SinonStub;
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('both/state/ducks/stories', () => {
|
||||
});
|
||||
|
||||
const getEmptyRootState = () => ({
|
||||
...rootReducer(undefined, noopAction()),
|
||||
...rootReducer(undefined, noopAction('getEmptyRootState')),
|
||||
stories: getEmptyState(),
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ const DEFAULT_RESERVATION = {
|
||||
};
|
||||
|
||||
describe('electron/state/ducks/username', () => {
|
||||
const emptyState = reducer(undefined, noopAction());
|
||||
const emptyState = reducer(undefined, noopAction('emptyState'));
|
||||
const stateWithReservation = {
|
||||
...emptyState,
|
||||
username: {
|
||||
|
||||
@@ -31,7 +31,7 @@ function voiceNoteDataForMessage(
|
||||
|
||||
describe('state/selectors/audioPlayer', () => {
|
||||
const getEmptyRootState = (): StateType => {
|
||||
return rootReducer(undefined, noopAction());
|
||||
return rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
};
|
||||
|
||||
describe('isPaused', () => {
|
||||
|
||||
@@ -36,7 +36,7 @@ const ACI_1 = generateAci();
|
||||
|
||||
describe('state/selectors/calling', () => {
|
||||
const getEmptyRootState = () => {
|
||||
const initial = rootReducer(undefined, noopAction());
|
||||
const initial = rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
return rootReducer(
|
||||
initial,
|
||||
userActions.userChanged({
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('both/state/selectors/conversations-extra', () => {
|
||||
const GROUP_ID = Bytes.toBase64(new Uint8Array(ID_LENGTH));
|
||||
|
||||
const getEmptyRootState = (): StateType => {
|
||||
return rootReducer(undefined, noopAction());
|
||||
return rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
};
|
||||
|
||||
function makeConversation(
|
||||
|
||||
@@ -44,7 +44,7 @@ function voiceNoteDataForMessage(
|
||||
|
||||
describe('both/state/ducks/audioPlayer', () => {
|
||||
const getEmptyRootState = (): StateType => {
|
||||
return rootReducer(undefined, noopAction());
|
||||
return rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
};
|
||||
|
||||
const getInitializedState = (): StateType => {
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('both/state/ducks/composer', () => {
|
||||
};
|
||||
|
||||
function getRootStateFunction(conversationId?: string) {
|
||||
const state = rootReducer(undefined, noopAction());
|
||||
const state = rootReducer(undefined, noopAction('getRootStateFunction'));
|
||||
return () => ({
|
||||
...state,
|
||||
nav: {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { generateAci } from '../../../types/ServiceId.std.ts';
|
||||
|
||||
describe('donations duck', () => {
|
||||
const getEmptyRootState = (): StateType =>
|
||||
rootReducer(undefined, noopAction());
|
||||
rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
|
||||
const storageMap = new Map<string, unknown>();
|
||||
const storage = {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { itemStorage } from '../../../textsecure/Storage.preload.ts';
|
||||
|
||||
describe('preferred reactions duck', () => {
|
||||
const getEmptyRootState = (): StateType =>
|
||||
rootReducer(undefined, noopAction());
|
||||
rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
|
||||
const getRootState = (
|
||||
preferredReactions: PreferredReactionsStateType
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('both/state/selectors/conversations-extra', () => {
|
||||
const SERVICE_ID_2 = generateAci();
|
||||
|
||||
const getEmptyRootState = (): StateType => {
|
||||
return rootReducer(undefined, noopAction());
|
||||
return rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
};
|
||||
|
||||
function makeConversation(id: string): ConversationType {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getIsCustomizingPreferredReactions } from '../../../state/selectors/pre
|
||||
|
||||
describe('both/state/selectors/preferredReactions', () => {
|
||||
const getEmptyRootState = (): StateType =>
|
||||
rootReducer(undefined, noopAction());
|
||||
rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
|
||||
const getRootState = (preferredReactions: PreferredReactionsStateType) => ({
|
||||
...getEmptyRootState(),
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('both/state/selectors/search', () => {
|
||||
});
|
||||
|
||||
const getEmptyRootState = (): StateType => {
|
||||
return rootReducer(undefined, noopAction());
|
||||
return rootReducer(undefined, noopAction('getEmptyRootState'));
|
||||
};
|
||||
|
||||
function getDefaultMessage(id: string): MessageType {
|
||||
|
||||
Reference in New Issue
Block a user