Commit 83cd63c2 authored by Martin Santangelo's avatar Martin Santangelo

Merge branch 'fix/refactor-blocked-channel-list' into release/3.11.0

parents 6aa3ace3 c2419214
......@@ -194,7 +194,7 @@ class EntitiesService {
this.addEntity(entity);
}
return response;
return response.entities;
} catch (err) {
console.log(err)
throw err;
......
......@@ -20,6 +20,7 @@ import Image from "react-native-image-progress";
import { CommonStyle } from "../../styles/Common";
import Touchable from "../../common/components/Touchable";
import Colors from "../../styles/Colors";
import CenteredLoading from '../../common/components/CenteredLoading';
export default class BlockedChannelsScreen extends Component {
static navigationOptions = {
......@@ -31,6 +32,7 @@ export default class BlockedChannelsScreen extends Component {
this.state = {
channels: [],
loading: true
}
}
......@@ -39,14 +41,12 @@ export default class BlockedChannelsScreen extends Component {
}
async load() {
await blockListService.doSync();
const guids = await blockListService.getList();
const channels = (await entitiesService.fetch(guids))
.filter(channel => Boolean(channel));
const channels = (await entitiesService.fetch(Array.from(guids.keys())));
//.filter(channel => Boolean(channel));
this.setState({
channels,
loading: false
});
}
......@@ -103,6 +103,10 @@ export default class BlockedChannelsScreen extends Component {
}
render() {
if (this.state.loading) {
return <CenteredLoading />
}
const rows = [];
for (const channel of this.state.channels) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment