Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(fix) channel updates with old data
· bfcbce1b
Martin Santangelo
authored
Dec 31, 2019
bfcbce1b
Merge branch 'fix/channels-update-twice-old-data' into 'release/3.15.0'
· 3c5e3d34
Brian Hatchet
authored
Jan 03, 2020
Fix channel updates with old data See merge request
!475
3c5e3d34
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
3c5e3d34
...
...
@@ -27,7 +27,7 @@
"
entities
"
:
"
^2.0.0
"
,
"
ethjs-signer
"
:
"
^0.1.1
"
,
"
i18n-js
"
:
"
^3.2.2
"
,
"
lodash
"
:
"
^4.17.1
1
"
,
"
lodash
"
:
"
^4.17.1
5
"
,
"
mobx
"
:
"
^5.14.0
"
,
"
mobx-react
"
:
"
^5.4.4
"
,
"
mobx-utils
"
:
"
^5.4.1
"
,
...
...
src/channel/ChannelScreen.js
View file @
3c5e3d34
...
...
@@ -43,17 +43,19 @@ export default
@
inject
(
'
channel
'
,
'
subscriptionRequest
'
)
@
observer
class
ChannelScreen
extends
Component
{
/**
* State
*/
state
=
{
guid
:
null
guid
:
null
,
};
/**
* Disable navigation bar
*/
static
navigationOptions
=
{
header
:
null
}
header
:
null
,
}
;
/**
* Load data on mount
...
...
@@ -78,6 +80,9 @@ class ChannelScreen extends Component {
}
}
/**
* Initial load
*/
async
initialLoad
()
{
const
params
=
this
.
props
.
navigation
.
state
.
params
;
...
...
@@ -92,6 +97,9 @@ class ChannelScreen extends Component {
}
}
/**
* Component will unmount
*/
componentWillUnmount
()
{
if
(
this
.
disposeEnter
)
{
this
.
disposeEnter
.
remove
();
...
...
@@ -100,8 +108,11 @@ class ChannelScreen extends Component {
this
.
props
.
channel
.
store
(
this
.
guid
).
markInactive
();
}
/**
* Load channel
* @param {string|UserModel} channelOrGuid
*/
async
loadChannel
(
channelOrGuid
)
{
const
isModel
=
channelOrGuid
instanceof
UserModel
;
const
guid
=
isModel
?
channelOrGuid
.
guid
:
channelOrGuid
;
const
store
=
this
.
props
.
channel
.
store
(
guid
);
...
...
@@ -160,14 +171,14 @@ class ChannelScreen extends Component {
// load feed now
store
.
feedStore
.
loadFeed
();
}
catch
(
err
)
{
}
catch
(
err
)
{
Alert
.
alert
(
i18n
.
t
(
'
attention
'
),
i18n
.
t
(
'
channel.notFound
'
),
[{
text
:
i18n
.
t
(
'
ok
'
),
onPress
:
()
=>
this
.
props
.
navigation
.
goBack
()
}],
{
cancelable
:
false
}
);
}
;
}
}
get
guid
()
{
...
...
src/channel/ChannelStore.js
View file @
3c5e3d34
import
{
observable
,
action
}
from
'
mobx
'
;
import
{
observable
,
action
}
from
'
mobx
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
channelService
from
'
./ChannelService
'
;
import
wireService
from
'
../wire/WireService
'
;
...
...
@@ -62,6 +60,9 @@ export default class ChannelStore {
@
action
async
load
(
defaultChannel
)
{
if
(
defaultChannel
)
{
defaultChannel
=
cloneDeep
(
defaultChannel
);
}
const
channel
=
await
channelsService
.
get
(
this
.
guid
,
defaultChannel
);
if
(
channel
)
{
...
...