chore: address PR comments

pull/3281/head
Audric Ackermann 4 months ago
parent 97e95efcf7
commit a44dc50d41
No known key found for this signature in database

@ -36,8 +36,8 @@
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
"start-prod:pretty": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron . | npx bunyan",
"start-dev": "cross-env NODE_ENV=development NODE_APP_INSTANCE=devprod$MULTI electron .",
"build-everything": "python3 --version && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything:soft": "python3 --version && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything": "yarn print-deps && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything:soft": "yarn print-deps && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything:watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && yarn build:workers && yarn tsc -w",
"start-dev:pretty": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron . | npx bunyan",
"build:workers": "yarn worker:utils && yarn worker:libsession",
@ -60,7 +60,8 @@
"worker:utils": "webpack --config=./utils.worker.config.js",
"worker:libsession": "rimraf 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js",
"dedup-yarn-lock": "npx --yes yarn-deduplicate yarn.lock",
"prepare": "husky install"
"prepare": "husky install",
"print-deps": "node -v && python3 --version"
},
"dependencies": {
"@emoji-mart/data": "^1.1.2",

@ -1,7 +1,7 @@
import styled from 'styled-components';
import { forwardRef } from 'react';
import { Localizer } from './Localizer';
import { LocalizerComponentPropsObject } from '../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../localization/localeTools';
const StyledI18nSubTextContainer = styled('div')`
font-size: var(--font-size-md);

@ -26,7 +26,7 @@ import { Localizer } from '../basic/Localizer';
import { SessionButtonColor } from '../basic/SessionButton';
import { SessionIcon } from '../icon';
import { getTimerNotificationStr } from '../../models/timerNotifications';
import { LocalizerComponentPropsObject } from '../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../localization/localeTools';
const FollowSettingButton = styled.button`
color: var(--primary-color);

@ -19,7 +19,7 @@ import {
import { Localizer } from '../../../basic/Localizer';
import { ExpirableReadableMessage } from './ExpirableReadableMessage';
import { NotificationBubble } from './notification-bubble/NotificationBubble';
import { LocalizerComponentPropsObject } from '../../../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../../../localization/localeTools';
// This component is used to display group updates in the conversation view.

@ -5,7 +5,7 @@ import { PubKey } from '../../../../session/types/PubKey';
import { Localizer } from '../../../basic/Localizer';
import { nativeEmojiData } from '../../../../util/emoji';
import { LocalizerComponentPropsObject } from '../../../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../../../localization/localeTools';
export type TipPosition = 'center' | 'left' | 'right';

@ -12,7 +12,7 @@ import { SpacerLG } from '../basic/Text';
import { SessionSpinner } from '../loading';
import { StyledI18nSubText } from '../basic/StyledI18nSubText';
import { LocalizerComponentPropsObject } from '../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../localization/localeTools';
export interface SessionConfirmDialogProps {
i18nMessage?: LocalizerComponentPropsObject;

@ -13,7 +13,7 @@ import { Localizer } from '../../basic/Localizer';
import { SessionButton, SessionButtonColor, SessionButtonType } from '../../basic/SessionButton';
import { StyledModalDescriptionContainer } from '../shared/ModalDescriptionContainer';
import { BlockOrUnblockModalState } from './BlockOrUnblockModalState';
import { LocalizerComponentPropsObject } from '../../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../../localization/localeTools';
type ModalState = NonNullable<BlockOrUnblockModalState>;

@ -17,7 +17,7 @@ import { deleteDbLocally } from '../../../util/accountManager';
import { Flex } from '../../basic/Flex';
import { SessionButtonColor } from '../../basic/SessionButton';
import { SessionIconButton } from '../../icon';
import { LocalizerComponentPropsObject } from '../../../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../../../localization/localeTools';
/** Min height should match the onboarding step with the largest height this prevents the loading spinner from jumping around while still keeping things centered */
const StyledBackButtonContainer = styled(Flex)`

@ -58,7 +58,7 @@ import { GroupPromote } from '../session/utils/job_runners/jobs/GroupPromoteJob'
import { MessageSender } from '../session/sending';
import { StoreGroupRequestFactory } from '../session/apis/snode_api/factories/StoreGroupRequestFactory';
import { DURATION } from '../session/constants';
import { LocalizerComponentPropsObject } from '../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../localization/localeTools';
export async function copyPublicKeyByConvoId(convoId: string) {
if (OpenGroupUtils.isOpenGroupV2(convoId)) {

@ -57,9 +57,12 @@ export function isPluralToken(token: string): token is PluralLocalizerTokens {
return token in pluralsDictionary;
}
type TokenWithArgs<D> = {
[K in keyof D]: D[K] extends { args: undefined } | { args: never } ? never : K;
}[keyof D];
/**
* This type extracts from a dictionary, the keys that have a property 'args' set (i.e. not undefined or never).
*/
type TokenWithArgs<Dict> = {
[Key in keyof Dict]: Dict[Key] extends { args: undefined } | { args: never } ? never : Key;
}[keyof Dict];
type MergedTokenWithArgs = TokenWithArgs<SimpleDictionary> | TokenWithArgs<PluralDictionary>;

@ -1,4 +1,4 @@
import { LocalizerComponentPropsObject } from '../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../localization/localeTools';
import { ConvoHub } from '../session/conversations';
import { UserUtils } from '../session/utils';

@ -5,7 +5,7 @@ import { PubKey } from '../session/types';
import { UserUtils } from '../session/utils';
import { TimerOptions } from '../session/disappearing_messages/timerOptions';
import { isLegacyDisappearingModeEnabled } from '../session/disappearing_messages/legacy';
import { LocalizerComponentPropsObject } from '../localization/localeTools';
import type { LocalizerComponentPropsObject } from '../localization/localeTools';
export function getTimerNotificationStr({
expirationMode,

@ -577,7 +577,7 @@ async function handleMemberAddedFromUI({
throw new Error('tried to make change to group but we do not have the admin secret key');
}
await checkWeAreAdminOrThrow(groupPk, 'handleMemberAddedFromUIOrNot');
await checkWeAreAdminOrThrow(groupPk, 'handleMemberAddedFromUI');
const { withHistory, withoutHistory, convo, us } = validateMemberAddChange({
withHistory: addMembersWithHistory,
@ -675,12 +675,12 @@ async function handleMemberAddedFromUI({
await LibSessionUtil.saveDumpsToDb(groupPk);
throw new Error(
'handleMemberAddedFromUIOrNot: pushChangesToGroupSwarmIfNeeded did not return success'
'handleMemberAddedFromUI: pushChangesToGroupSwarmIfNeeded did not return success'
);
}
} catch (e) {
window.log.warn(
'handleNameChangeFromUIOrNot: pushChangesToGroupSwarmIfNeeded failed with:',
'handleMemberAddedFromUI: pushChangesToGroupSwarmIfNeeded failed with:',
e.message
);
}

@ -18,4 +18,4 @@ getMessageDefaultCopy.strippedWithObj = strippedWithObj;
getMessageDefaultCopy.getRawMessage = getRawMessage;
getMessageDefaultCopy.formatMessageWithArgs = formatMessageWithArgs;
export const getMessage: SetupI18nReturnType = getMessageDefault as SetupI18nReturnType;
export const getMessage: SetupI18nReturnType = getMessageDefaultCopy as SetupI18nReturnType;

2
ts/window.d.ts vendored

@ -6,7 +6,7 @@ import { Persistor } from 'redux-persist/es/types';
import { PrimaryColorStateType, ThemeStateType } from './themes/constants/colors';
import type { GetMessageArgs, I18nMethods } from './types/localizer';
import { MergedLocalizerTokens } from './localization/localeTools';
import type { MergedLocalizerTokens } from './localization/localeTools';
export interface LibTextsecure {
messaging: boolean;

Loading…
Cancel
Save