Chanege roomIdByLastActive func name
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
075ed147e9
commit
45ae73f545
3 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ import initMatrix from '../../../client/initMatrix';
|
||||||
import cons from '../../../client/state/cons';
|
import cons from '../../../client/state/cons';
|
||||||
import navigation from '../../../client/state/navigation';
|
import navigation from '../../../client/state/navigation';
|
||||||
import Postie from '../../../util/Postie';
|
import Postie from '../../../util/Postie';
|
||||||
import { roomIdByLastActive } from '../../../util/sort';
|
import { roomIdByActivity } from '../../../util/sort';
|
||||||
|
|
||||||
import RoomsCategory from './RoomsCategory';
|
import RoomsCategory from './RoomsCategory';
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function Directs() {
|
||||||
const { roomList, notifications } = initMatrix;
|
const { roomList, notifications } = initMatrix;
|
||||||
const [directIds, setDirectIds] = useState([]);
|
const [directIds, setDirectIds] = useState([]);
|
||||||
|
|
||||||
useEffect(() => setDirectIds([...roomList.directs].sort(roomIdByLastActive)), []);
|
useEffect(() => setDirectIds([...roomList.directs].sort(roomIdByActivity)), []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleTimeline = (event, room, toStartOfTimeline, removed, data) => {
|
const handleTimeline = (event, room, toStartOfTimeline, removed, data) => {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import initMatrix from '../../../client/initMatrix';
|
||||||
import cons from '../../../client/state/cons';
|
import cons from '../../../client/state/cons';
|
||||||
import navigation from '../../../client/state/navigation';
|
import navigation from '../../../client/state/navigation';
|
||||||
import Postie from '../../../util/Postie';
|
import Postie from '../../../util/Postie';
|
||||||
import { roomIdByLastActive, roomIdByAtoZ } from '../../../util/sort';
|
import { roomIdByActivity, roomIdByAtoZ } from '../../../util/sort';
|
||||||
|
|
||||||
import RoomsCategory from './RoomsCategory';
|
import RoomsCategory from './RoomsCategory';
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ function Home({ spaceId }) {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{ directIds.length !== 0 && (
|
{ directIds.length !== 0 && (
|
||||||
<RoomsCategory name="People" roomIds={directIds.sort(roomIdByLastActive)} drawerPostie={drawerPostie} />
|
<RoomsCategory name="People" roomIds={directIds.sort(roomIdByActivity)} drawerPostie={drawerPostie} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{ isCategorized && [...categories].map(([catId, childIds]) => {
|
{ isCategorized && [...categories].map(([catId, childIds]) => {
|
||||||
|
@ -88,7 +88,7 @@ function Home({ spaceId }) {
|
||||||
else rms.push(id);
|
else rms.push(id);
|
||||||
});
|
});
|
||||||
rms.sort(roomIdByAtoZ);
|
rms.sort(roomIdByAtoZ);
|
||||||
dms.sort(roomIdByLastActive);
|
dms.sort(roomIdByActivity);
|
||||||
return (
|
return (
|
||||||
<RoomsCategory
|
<RoomsCategory
|
||||||
key={catId}
|
key={catId}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import initMatrix from '../client/initMatrix';
|
import initMatrix from '../client/initMatrix';
|
||||||
|
|
||||||
export function roomIdByLastActive(id1, id2) {
|
export function roomIdByActivity(id1, id2) {
|
||||||
const room1 = initMatrix.matrixClient.getRoom(id1);
|
const room1 = initMatrix.matrixClient.getRoom(id1);
|
||||||
const room2 = initMatrix.matrixClient.getRoom(id2);
|
const room2 = initMatrix.matrixClient.getRoom(id2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue