Commit graph

1142 commits

Author SHA1 Message Date
Luke Barnard
28818b857a Remove log 2017-04-19 10:17:44 +01:00
Luke Barnard
81bdfe2126 Update to match renamed API 2017-04-19 10:14:57 +01:00
Luke Barnard
c431c9ab22 Clarify comment 2017-04-18 15:18:21 +01:00
Luke Barnard
d38520dfb4 Undo change in ghost RM logic
Put a XXX to indicate that the ghost tile should be replaced with something mor e stable. As it stands, the ghost will appear, potentially at a different position to the RMs actual position
2017-04-18 15:17:42 +01:00
Luke Barnard
d33afa99ab marker -> event_id 2017-04-18 15:13:05 +01:00
Luke Barnard
4b5364e9ae Merge branch 'develop' into luke/feature-read-marker 2017-04-18 14:45:18 +01:00
Luke Barnard
28ed69b617 m.read_marker -> m.fully_read 2017-04-18 14:44:43 +01:00
Luke Barnard
a29d8c2af2 Merge pull request #765 from t3chguy/t3chguy/escape-closes-user-settings
Escape closes UserSettings
2017-04-12 15:18:19 +01:00
Luke Barnard
9c9dc84f45 Remove redundant setting of readMarkerEventId 2017-04-12 15:12:37 +01:00
Luke Barnard
249e42747b Fix bug where roomId was expected to be a property on timelineSet 2017-04-12 15:09:56 +01:00
Luke Barnard
1c25ed89b0 Initial implementation of using new RM API
As detailed here https://docs.google.com/document/d/1UWqdS-e1sdwkLDUY0wA4gZyIkRp-ekjsLZ8k6g_Zvso/edit, the RM state is no longer kept locally, but rather server-side. The client now uses it's locally-calculated RM to update the server and receives server updates via the per-room account data.

The sending of the RR has been bundled in to reduce traffic when sending both. In effect, whenever a RR is sent the RM is sent with it but using the new API.

This uses a js-sdk change which has set to be finalised and so might change.
2017-04-12 15:05:39 +01:00
Luke Barnard
424aae6b91 Prevent the ghost and real RM tile from both appearing 2017-04-12 15:04:38 +01:00
David Baker
d4dc16545a Fix people section vanishing on 'clear cache'
Stop the client first

Fixes https://github.com/vector-im/riot-web/issues/3610
2017-04-11 18:16:29 +01:00
David Baker
811cd79206 Make the clear cache button work on desktop
Fixes https://github.com/vector-im/riot-web/issues/3597
2017-04-10 17:39:27 +01:00
Matthew Hodgson
6dbb4e9002 fix the warning shown to users about needing to export e2e keys
apparently when we added the buttons to export e2e keys to the Logout button, we didn't change the text warning the user that e2e export was coming soon.  likewise when changing password and forgetting password (where we didn't even have a button to export keys)
2017-04-07 23:34:11 +01:00
Richard van der Hoff
6352784a2c Merge pull request #795 from matrix-org/luke/fix-pagination3
Fix infinite pagination/glitches with pagination
2017-04-07 13:24:22 +01:00
Luke Barnard
d218f90cde Fix infinite pagination/glitches with pagination
I think this was being caused by a bug introduced in 47f29b that meant that `backwards` was actually being used as `forwards`.
2017-04-07 11:34:31 +01:00
Luke Barnard
a815788af8 Fix issue where teamTokenMap was ignored for guests
This was an issue because guests do not log in with a teamToken, it is implicitly set by MatrixChat when it mounts. The fix is to view_home_page when a login occurs and MatrixChat has this._teamToken set.
2017-04-06 17:10:32 +01:00
Luke Barnard
880a48494b Merge pull request #785 from matrix-org/luke/fix-scroll-past-big-event
Fix scroll token selection logic
2017-04-06 12:36:30 +01:00
Luke Barnard
5f8a7b46a8 Remove redundant setState call, always focus composer after sync 2017-04-06 11:44:25 +01:00
Luke Barnard
95b40a976c Replace sdkReady with firstSyncPromise, add mx_last_room_id
- Create a promise that will serve as a lock to be blocked on by things that need to wait for the first sync before accessing state.
- Use this promise to block `view_room` calls until a sync has occured instead of just dropping them silently if the sync hasn't happened yet.
- Store the current room ID in a localStorage item `mx_last_room_id` when `view_room` fires. This persists the last viewed room ID so that it can be restored on refresh, browser quit. This replaces the previous logic which set the room following a sync based on the most recent unread room.
2017-04-06 11:38:06 +01:00
Luke Barnard
b0a04e6f00 Clarify comment 2017-04-05 17:52:05 +01:00
Luke Barnard
423babdb17 Remove fairly redundant condition
Making sure that a node is intersected by the bottom of the wrapper is a bit overkill, given that we iterate from the bottom. This also prevents the scenario of having no nodes that are not precisely intersected, but possibly straddling the bottom of the wrapper.
2017-04-05 17:51:07 +01:00
Luke Barnard
47f29b9454 Simplify simulated unfill 2017-04-05 17:48:24 +01:00
Luke Barnard
5737994957 Clarify and simplfiy unpagination logic 2017-04-04 13:28:26 +01:00
Luke Barnard
94fe9999db Reimplement _saveScrollState
The actual fix to https://github.com/vector-im/riot-web/issues/3175 is this change to `_saveScrollState`, which is to pick the trackedScrollToken based on which node is intersected by the bottom of the scroll panel. This is opposed to the previous logic that picked based on which node was the first from the bottom to be above the bottom of the viewport.

In the case where the viewport bottom does not intersect any events, the topmost event is used.
2017-04-04 11:55:53 +01:00
Luke Barnard
8e5a83a056 Reduce number of unpaginated events by 1
When unpaginating in the backwards direction
2017-03-30 18:02:33 +01:00
Luke Barnard
fff83ba234 Fix the onFinished for timeline pos dialog
This was causing a blank RoomView because it was trying to work with `room_id = undefined`.
2017-03-30 17:18:22 +01:00
David Baker
dff79984a6 Merge remote-tracking branch 'origin/develop' into dbkr/remove_session_load_error 2017-03-29 18:24:06 +01:00
David Baker
22b0f69ac9 Merge pull request #782 from matrix-org/dbkr/matrixchat_tidy
Use Login & Register via component interface
2017-03-29 18:23:36 +01:00
Luke Barnard
5a411ba005 Merge pull request #781 from matrix-org/luke/fix-flaky-tests-maybe
Attempt to fix the flakyness seen with tests
2017-03-29 17:32:56 +02:00
David Baker
a6612bb8ad Remove non-functional session load error
MatrixChat was trying to display an error if the session failed to
restore, but it was never actually being shown because it was just
set as a member variable and therefore never actually caused
a re-render for the error to be displayed. Almost all errors are
caught by _restoreFromLocalStorage which displays the fancy dialog
if your session can't be restored, so I'm not convinced this ever
even tried to do anything anyway. Remove it.
2017-03-29 16:23:18 +01:00
David Baker
cee2628b41 Use Login & Register via component interface
Login & Register were being imprted directly for some reason,
rather than going via the normal component interface.

Should be functionally identical.
2017-03-29 15:24:47 +01:00
Luke Barnard
2146e89c09 Attempt to fix the flakyness seen with tests
Specifically:
```

JS 2.1.1 (Linux 0.0.0) joining a room over federation should not get stuck at a spinner FAILED
	Did not find exactly one match (found: 0) for componentType:function (props, context, updater) {
```

actually meant that the room directory wasn't displayed - probably because the dispatch `view_room_directory` ended up on another tick of the event loop, meaning that the directory wasn't displayedi. The fix attempted in ths commit is to use `this._setPage` instead to view the directory. This uses `setState` to set the screen to the directory, so I'm not entirely convinced this will solve the problem (as `setState` may also end up doing things on another tick.

and

```
JS 2.1.1 (Linux 0.0.0) loading: MatrixClient rehydrated from stored credentials: shows a room view if we followed a room link FAILED
	MatrixChat still not ready after 5 tries
	awaitRoomView@/home/travis/build/vector-im/riot-web/test/all-tests.js:201363:90
```

was happening probably because in the handler for the `sync` event in `MatrixChat` (around line 840), there was one case in which the `ready` state may not be true (causing all 5 attempts to fail), and this case relied on `starting_room_alias_payload`. This `starting_room_alias_payload` is now redundant because of `initialScreenAfterLogin`, which was added recently.
2017-03-29 15:02:28 +01:00
David Baker
90242c2c85 Only send local echo RR if we're at the end 2017-03-29 14:12:50 +01:00
David Baker
3373f00d90 Only clear the local notification count if needed
Only zero the local notification count when we actually send a
read receipt, otherwise we cause a re-render of the RoomList every
time the user moves the cursor in the window, basically.
2017-03-29 14:08:31 +01:00
David Baker
91d10646b5 Merge pull request #775 from matrix-org/luke/fix-RoomList-notif-flashing
Improve zeroing of RoomList notification badges
2017-03-28 11:33:38 +01:00
Luke Barnard
4a0988f83e Do not send the room with action
By not sending the room with the action, we prevent its state from being updated by registered views listening for on_room_read
2017-03-28 11:26:40 +01:00
Luke Barnard
f4dc7ae8b1 Improve zeroing of RoomList notification badges
Use an action and force an update when zeroing the number of notifications in a room. This is better than waiting for a `render` to happen at some point. This will hopefully fix https://github.com/vector-im/riot-web/issues/3257
2017-03-28 10:38:57 +01:00
Luke Barnard
ffd8ef84d6 Fix VOIP bar hidden on first render of RoomStatusBar
componentDidUpdate is not called for the initial render of a React component (https://facebook.github.io/react/docs/react-component.html#componentdidupdate)

componentWillMount is used so that the initial state and props of RoomStatusBar can also trigger props.isVisible.

This fixes https://github.com/vector-im/riot-web/issues/3181
2017-03-28 09:30:41 +01:00
Luke Barnard
c650cfffac logged_in -> loggedIn
Also added `loggingIn` to `initialState` and removed some commented code.
2017-03-27 17:14:39 +01:00
Luke Barnard
30c5af35e5 Add state loggingIn to MatrixChat to fix flashing login
To prevent the login screen from flashing when refreshing the app, use some state to indicate that a login is in progress, and OR that with the existing `loading` boolean to show the `<Spinner>` instead of the default `<Login>`.

This might be too invasive, and a default spinner may be better.
2017-03-27 16:39:04 +01:00
David Baker
a8d85ca2ad Merge pull request #756 from matrix-org/dbkr/add_msisdn
Support adding phone numbers in UserSettings
2017-03-24 10:54:22 +00:00
David Baker
5e3b991ec2 PR feedback fixes 2017-03-24 10:45:38 +00:00
Kegsay
3d71cb8325 Merge pull request #768 from matrix-org/kegan/memleaks-are-bad-mkay
Add canResetTimeline callback and thread it through to TimelinePanel
2017-03-22 16:39:07 +00:00
David Baker
4cd24d15d4 Factor out AddPhoneNumber to a separate component 2017-03-22 15:18:27 +00:00
Kegan Dougal
4cebded04f Add canResetTimeline callback and thread it through to TimelinePanel 2017-03-22 15:06:52 +00:00
David Baker
6a37fc4325 Comment typos 2017-03-22 12:00:16 +00:00
David Baker
6a56828974 Just return the promise if it's a bg request
This makes the code a bit neater.
2017-03-22 11:25:33 +00:00
David Baker
5ae7d5e4b2 More comments 2017-03-22 11:13:00 +00:00