Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
174
Merge Requests
21
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Compare Revisions
8cad6f692378901013dd7bbaf86d8ec2fcd2a904...28f014edc15ad5052486641444a7391a963f0a6e
Source
28f014edc15ad5052486641444a7391a963f0a6e
...
Target
8cad6f692378901013dd7bbaf86d8ec2fcd2a904
Compare
Commits (2)
(fix) messenger dot not updating and search lost when user returns to the screen
· 5bd8a4f0
Martin Santangelo
authored
1 hour ago
5bd8a4f0
(feat) set conversation unreaded on open
· 28f014ed
Martin Santangelo
authored
1 hour ago
28f014ed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
37 deletions
+24
-37
src/messenger/ConversationModel.js
View file @
28f014ed
import
BaseModel
from
'
../common/BaseModel
'
;
import
{
observable
}
from
'
mobx
'
;
/**
* Conversation model
*/
export
default
class
ConversationModel
extends
BaseModel
{
@
observable
unread
=
false
;
@
observable
online
=
false
;
//TODO: move decryption logic here
}
This diff is collapsed.
src/messenger/ConversationScreen.js
View file @
28f014ed
...
...
@@ -71,6 +71,7 @@ export default class ConversationScreen extends Component {
let
conversation
;
if
(
params
.
conversation
)
{
conversation
=
params
.
conversation
;
conversation
.
unread
=
false
;
}
else
{
// open conversation with params.target user (minor guid go first)
if
(
params
.
target
>
this
.
props
.
user
.
me
.
guid
)
{
...
...
This diff is collapsed.
src/messenger/MessengerConversationStore.js
View file @
28f014ed
import
{
observable
,
action
,
inject
}
from
'
mobx
'
;
import
{
Alert
}
from
'
react-native
'
;
import
messengerService
from
'
./MessengerService
'
;
import
crypto
from
'
./../common/services/crypto.service
'
;
import
socket
from
'
../common/services/socket.service
'
;
...
...
@@ -18,7 +13,6 @@ import logService from '../common/services/log.service';
* Messenger Conversation Store
*/
class
MessengerConversationStore
{
/**
* Messages observable
*/
...
...
This diff is collapsed.
src/messenger/MessengerListStore.js
View file @
28f014ed
...
...
@@ -90,9 +90,7 @@ class MessengerListStore {
@
action
touchConversation
=
(
guid
)
=>
{
// search conversation
const
index
=
this
.
conversations
.
findIndex
((
conv
)
=>
{
return
conv
.
guid
==
guid
;
})
const
index
=
this
.
conversations
.
findIndex
(
conv
=>
conv
.
guid
===
guid
);
if
(
index
!==
-
1
)
{
const
conv
=
this
.
conversations
[
index
];
...
...
@@ -136,7 +134,7 @@ class MessengerListStore {
try
{
// is a search?
if
(
this
.
search
&&
this
.
newsearch
)
{
if
(
this
.
search
&&
(
this
.
newsearch
||
reload
)
)
{
this
.
newsearch
=
false
;
response
=
await
messengerService
.
searchConversations
(
this
.
search
,
rows
,
this
);
}
else
{
...
...
This diff is collapsed.
src/messenger/MessengerScreen.js
View file @
28f014ed
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
Text
,
View
,
Alert
,
Image
,
Platform
,
FlatList
,
StyleSheet
,
ActivityIndicator
,
Dimensions
,
}
from
'
react-native
'
;
import
{
inject
,
observer
}
from
'
mobx-react/native
'
import
{
inject
,
observer
}
from
'
mobx-react/native
'
;
import
_
from
'
lodash
'
;
...
...
@@ -26,9 +19,7 @@ import Icon from 'react-native-vector-icons/MaterialIcons';
import
ConversationView
from
'
./conversation/ConversationView
'
;
import
SearchView
from
'
../common/components/SearchView
'
;
import
{
CommonStyle
}
from
'
../styles/Common
'
;
import
{
ComponentsStyle
}
from
'
../styles/Components
'
;
import
Colors
from
'
../styles/Colors
'
;
import
{
ComponentsStyle
}
from
'
../styles/Components
'
;
import
MessengerTabIcon
from
'
./MessengerTabIcon
'
;
import
ErrorLoading
from
'
../common/components/ErrorLoading
'
;
import
i18n
from
'
../common/services/i18n.service
'
;
...
...
@@ -36,24 +27,23 @@ import i18n from '../common/services/i18n.service';
/**
* Messenger Conversarion List Screen
*/
export
default
@
inject
(
'
messengerList
'
)
@
observer
export
default
class
MessengerScreen
extends
Component
{
class
MessengerScreen
extends
Component
{
state
=
{
active
:
false
,
}
}
;
static
navigationOptions
=
{
tabBarIcon
:
({
tintColor
})
=>
(
<
MessengerTabIcon
tintColor
=
{
tintColor
}
/
>
)
}
tabBarIcon
:
({
tintColor
})
=>
<
MessengerTabIcon
tintColor
=
{
tintColor
}
/>
,
};
/**
* On component will mount
*/
componentDidMount
()
{
// load list
this
.
props
.
messengerList
.
loadList
();
// listen socket on app start
...
...
@@ -185,41 +175,41 @@ export default class MessengerScreen extends Component {
*/
searchChange
=
(
search
)
=>
{
this
.
searchDebouncer
(
search
);
}
}
;
/**
* Clear and reload
*/
refresh
=
()
=>
{
this
.
props
.
messengerList
.
refresh
();
}
}
;
/**
* Load more rows
*/
loadMore
=
()
=>
{
this
.
props
.
messengerList
.
loadList
()
}
this
.
props
.
messengerList
.
loadList
()
;
}
;
/**
* render row
* @param {object} row
*/
renderMessage
=
(
row
)
=>
{
renderMessage
=
row
=>
{
return
(
<
ConversationView
item
=
{
row
.
item
}
styles
=
{
styles
}
navigation
=
{
this
.
props
.
navigation
}
testID
=
{
row
.
item
.
username
.
toUpperCase
()}
/
>
/
>
);
}
}
;
}
// styles
const
styles
=
StyleSheet
.
create
({
listView
:
{
listView
:
{
//paddingTop: 20,
flex
:
1
},
...
...
This diff is collapsed.