Skip to content

Commit 4f51c28

Browse files
authored
Merge pull request #1552 from Bilb/fix-animateed-profile-pic-small-issues
fix: address small issues with Animated profile pic
2 parents ff0b170 + fb1c433 commit 4f51c28

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

ts/components/dialog/DeleteAccountModal.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import { updateDeleteAccountModal } from '../../state/ducks/modalDialog';
55
import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton';
66
import { SessionSpinner } from '../loading';
77

8-
import {
9-
deleteEverythingAndNetworkData,
10-
sendConfigMessageAndDeleteEverything,
11-
} from '../../util/accountManager';
8+
import { deleteEverythingAndNetworkData, deleteAccountLocally } from '../../util/accountManager';
129
import { SessionRadioGroup } from '../basic/SessionRadioGroup';
1310
import { tr } from '../../localization/localeTools';
1411
import {
@@ -92,7 +89,7 @@ export const DeleteAccountModal = () => {
9289
try {
9390
window.log.warn('Deleting everything on device but keeping network data');
9491

95-
await sendConfigMessageAndDeleteEverything();
92+
await deleteAccountLocally();
9693
} catch (e) {
9794
window.log.warn(e);
9895
} finally {

ts/components/dialog/EditProfilePictureModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const StyledAvatarContainer = styled.div`
4848

4949
const StyledCTADescription = styled.span<{ reverseDirection: boolean }>`
5050
text-align: center;
51+
cursor: pointer;
5152
font-size: var(--font-size-lg);
5253
color: var(--text-secondary-color);
5354
line-height: normal;
@@ -276,7 +277,7 @@ export const EditProfilePictureModal = ({ conversationId }: EditProfilePictureMo
276277
}
277278
>
278279
{isMe && proBadgeCb.cb ? (
279-
<StyledCTADescription reverseDirection={userHasPro}>
280+
<StyledCTADescription reverseDirection={userHasPro} onClick={proBadgeCb.cb}>
280281
{tr(
281282
userHasPro
282283
? 'proAnimatedDisplayPictureModalDescription'

ts/components/leftpane/ActionsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const triggerSyncIfNeeded = async () => {
215215

216216
const triggerAvatarReUploadIfNeeded = async () => {
217217
const lastAvatarUploadExpiryMs =
218-
(await Data.getItemById(SettingsKey.ntsAvatarExpiryMs))?.value || 0;
218+
(await Data.getItemById(SettingsKey.ntsAvatarExpiryMs))?.value || Number.MAX_SAFE_INTEGER;
219219

220220
if (NetworkTime.now() > lastAvatarUploadExpiryMs) {
221221
window.log.info('Reuploading avatar...');

ts/interactions/avatar-interactions/nts-avatar-interactions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export async function reuploadCurrentAvatarUs() {
3131
const profileKey = ourConvoProfileKey ? fromHexToArray(ourConvoProfileKey) : null;
3232
if (!profileKey || isEmpty(profileKey)) {
3333
window.log.info('reuploadCurrentAvatarUs: our profileKey empty');
34+
3435
return null;
3536
}
3637
// Note: we do want to grab the current non-static avatar path here

ts/util/accountManager.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ import { getSwarmPollingInstance } from '../session/apis/snode_api';
1616
import { mnDecode, mnEncode } from '../session/crypto/mnemonic';
1717
import { getOurPubKeyStrFromCache } from '../session/utils/User';
1818
import { LibSessionUtil } from '../session/utils/libsession/libsession_utils';
19-
import { forceSyncConfigurationNowIfNeeded } from '../session/utils/sync/syncUtils';
2019
import { updateConfirmModal, updateDeleteAccountModal } from '../state/ducks/modalDialog';
2120
import { userActions } from '../state/ducks/user';
2221
import { Registration } from './registration';
2322
import { Storage, saveRecoveryPhrase, setLocalPubKey, setSignInByLinking } from './storage';
2423
import { PromiseUtils } from '../session/utils';
2524
import { SnodeAPI } from '../session/apis/snode_api/SNodeAPI';
26-
import { ReduxOnionSelectors } from '../state/selectors/onions';
2725
import { tr } from '../localization/localeTools';
2826

2927
/**
@@ -269,18 +267,10 @@ export const deleteDbLocally = async () => {
269267
window.localStorage.setItem('restart-reason', 'delete-account');
270268
};
271269

272-
export async function sendConfigMessageAndDeleteEverything() {
270+
export async function deleteAccountLocally() {
273271
try {
274-
// DELETE LOCAL DATA ONLY, NOTHING ON NETWORK
275-
window?.log?.info('DeleteAccount => Sending a last SyncConfiguration');
276-
if (ReduxOnionSelectors.isOnlineOutsideRedux()) {
277-
// be sure to wait for the message being effectively sent. Otherwise we won't be able to encrypt it for our devices !
278-
await forceSyncConfigurationNowIfNeeded(true);
279-
window?.log?.info('Last configuration message sent!');
280-
} else {
281-
window?.log?.warn('sendConfigMessageAndDeleteEverything: we are offline, just deleting');
282-
}
283-
272+
// Note: no point uploading a last config message as
273+
// the user configs are being pushed after every changes made to them.
284274
await deleteDbLocally();
285275
} catch (error) {
286276
// if an error happened, it's not related to the delete everything on network logic as this is handled above.

0 commit comments

Comments
 (0)