1
0
Fork 0
mirror of https://github.com/mat-1/variance.git synced 2025-08-02 15:26:04 +00:00

disable zoom on mobile and other qol changes

This commit is contained in:
mat 2025-01-07 10:19:20 +00:00
parent db14366000
commit f34d78110a
5 changed files with 33 additions and 6 deletions

View file

@ -1,6 +1,7 @@
# Variance
A Matrix client that aims to be user-friendly and provide an experience similar to Discord. It's based on [Cinny](https://github.com/cinnyapp/cinny).
A Matrix client that aims to be user-friendly and provide an experience similar to Discord. It's a hard-fork of [Cinny](https://github.com/cinnyapp/cinny).
- [Contributing](./CONTRIBUTING.md)
## Getting started

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0" />
<title>Variance</title>
<meta name="name" content="Variance" />
<meta name="author" content="Variance and Cinny contributors" />

View file

@ -142,6 +142,9 @@ function DeviceManage() {
if (!mountStore.getItem()) return;
removeFromProcessing(device);
// not all homeservers send this event when we update devices, so we need to send it ourselves to make the ui update
mx.emit(CryptoEvent.DevicesUpdated, [mx.getUserId()!], true);
};
const verifyWithKey = async (device: IMyDevice) => {
@ -172,6 +175,9 @@ function DeviceManage() {
const isCurrentDevice = mx.deviceId === deviceId;
const canVerify = isVerified === false && (isMeVerified || isCurrentDevice);
// more than 90 days old
const isLastTimestampOld = lastTS < Date.now() - 1000 * 60 * 60 * 24 * 90;
return (
<SettingTile
key={deviceId}
@ -216,8 +222,15 @@ function DeviceManage() {
{lastTS && (
<Text variant="b3">
Last activity
<span style={{ color: 'var(--tc-surface-normal)' }}>
<span
style={{
color: isLastTimestampOld
? 'var(--tc-danger-high)'
: 'var(--tc-surface-normal)',
}}
>
{dateFormat(new Date(lastTS), ' hh:MM TT, dd/mm/yyyy')}
{isLastTimestampOld ? ' (old)' : ''}
</span>
{lastIP ? ` at ${lastIP}` : ''}
</Text>

View file

@ -68,6 +68,12 @@ function listenKeyboard(e: KeyboardEvent) {
'.room-selector__content',
) as HTMLDivElement;
roomSelectorContent.click();
// scroll the room into view
nextRoomSelector.scrollIntoView({
behavior: 'instant',
block: 'nearest',
inline: 'nearest',
});
}
}
}

View file

@ -16,6 +16,7 @@ import initMatrix from '../initMatrix';
import cons from './cons';
import settings from './settings';
import { CryptoBackend } from 'matrix-js-sdk/lib/common-crypto/CryptoBackend';
function isEdited(mEvent: MatrixEvent) {
return mEvent.getRelation()?.rel_type === 'm.replace';
@ -271,7 +272,9 @@ class RoomTimeline extends EventEmitter {
try {
await this.matrixClient.paginateEventTimeline(timelineToPaginate, { backwards, limit });
if (this.isEncrypted()) await this.decryptAllEventsOfTimeline(this.activeTimeline);
if (this.isEncrypted()) {
await this.decryptAllEventsOfTimeline(this.activeTimeline);
}
this._populateTimelines();
const loaded = this.timeline.length - oldSize;
@ -288,9 +291,13 @@ class RoomTimeline extends EventEmitter {
decryptAllEventsOfTimeline(eventTimeline: EventTimeline) {
const decryptionPromises = eventTimeline
.getEvents()
.filter((event) => event.shouldAttemptDecryption())
.filter((event) => event.shouldAttemptDecryption() || event.isBeingDecrypted())
.reverse()
.map((event) => event.attemptDecryption(this.matrixClient.getCrypto(), { isRetry: true }));
.map(
(event) =>
event.getDecryptionPromise() ||
event.attemptDecryption(this.matrixClient.getCrypto() as CryptoBackend),
);
return Promise.allSettled(decryptionPromises);
}