Skip to content

Commit 3b77008

Browse files
authored
Merge pull request #36 from just4fun/v1.6.1
v1.6.1
2 parents a44c826 + 4038c48 commit 3b77008

File tree

9 files changed

+39
-28
lines changed

9 files changed

+39
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For all officially recommended clients, please visit http://bbs.uestc.edu.cn/for
1212

1313
![app_icon](https://cloud.githubusercontent.com/assets/7512625/18613513/348f7322-7daf-11e6-902d-94776bb55670.jpg)
1414

15-
## Status (v1.6.0)
15+
## Status (v1.6.1)
1616

1717
[<img width="250" alt="download_on_the_app_store" src="https://user-images.githubusercontent.com/7512625/27969868-353f554c-637f-11e7-869d-3963933461ca.png">](https://itunes.apple.com/cn/app/qing-shui-he-pan-stuhome/id1190564355)
1818

ios/stuhome/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundlePackageType</key>
2020
<string>APPL</string>
2121
<key>CFBundleShortVersionString</key>
22-
<string>1.6.0</string>
22+
<string>1.6.1</string>
2323
<key>CFBundleSignature</key>
2424
<string>????</string>
2525
<key>CFBundleVersion</key>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stuhome",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "An iOS client for http://bbs.uestc.edu.cn/ written in React Native with Redux.",
55
"author": "just4fun <houritsunohikari@gmail.com>",
66
"scripts": {

src/components/Avatar.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
TouchableOpacity
66
} from 'react-native';
77
import styles from '../styles/components/_Avatar';
8-
import colors from '../styles/common/_colors';
98

109
export default class Avatar extends Component {
1110
render() {
@@ -21,7 +20,6 @@ export default class Avatar extends Component {
2120

2221
return (
2322
<TouchableOpacity
24-
underlayColor={colors.underlay}
2523
onPress={() => {
2624
if (onPress) {
2725
onPress();

src/components/MenuProfile.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import {
33
View,
44
Text,
55
Image,
6-
TouchableHighlight,
6+
TouchableOpacity,
77
} from 'react-native';
88
import styles from '../styles/components/_MenuProfile';
9-
import colors from '../styles/common/_colors';
109

1110
export default class MenuProfile extends Component {
1211
render() {
@@ -24,25 +23,23 @@ export default class MenuProfile extends Component {
2423
<View style={styles.menuHeader}>
2524
<View>
2625
{token &&
27-
<TouchableHighlight
26+
<TouchableOpacity
2827
style={styles.avatar}
29-
underlayColor={colors.underlay}
3028
onPress={() => navigation.navigate('Information', { userId: uid })}>
3129
<Image
3230
key={avatar}
3331
style={styles.avatar}
3432
source={{ uri: avatar }} />
35-
</TouchableHighlight>
33+
</TouchableOpacity>
3634
||
37-
<TouchableHighlight
35+
<TouchableOpacity
3836
style={styles.avatar}
39-
underlayColor={colors.underlay}
4037
onPress={() => navigation.navigate('LoginModal')}>
4138
<Image
4239
key='noavatar'
4340
style={styles.avatar}
4441
source={require('../images/noavatar.jpg')} />
45-
</TouchableHighlight>
42+
</TouchableOpacity>
4643
}
4744
<Text style={styles.name}>{token ? userName : '请先登录'}</Text>
4845
</View>

src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121

2222
MAX_UPLOAD_IMAGES_COUNT: 9,
2323

24-
VERSION: 'v1.6.0',
24+
VERSION: 'v1.6.1',
2525

2626
AUTHOR_ID: 32044,
2727

src/containers/Individual.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class Individual extends Component {
138138
<View style={mainStyles.container}>
139139
<View style={styles.header}>
140140
<TouchableOpacity
141-
underlayColor={colors.underlay}
142141
onPress={() => {
143142
navigation.navigate('Information', { userId: this.userId });
144143
}}>

src/containers/TopicDetail.js

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ class TopicDetail extends Component {
181181
let commentHeaderText =
182182
topic.replies > 0 ? (topic.replies + '条评论') : '还没有评论,快来抢沙发!';
183183

184+
// Same with f227938f.
185+
if (topic.user_id === 0) {
186+
topic.user_nick_name = '匿名';
187+
}
188+
184189
return (
185190
<View>
186191
<View style={styles.top}>
@@ -409,18 +414,24 @@ class TopicDetail extends Component {
409414
keyExtractor={(item, index) => index}
410415
removeClippedSubviews={false}
411416
enableEmptySections={true}
412-
renderItem={({ item: comment }) =>
413-
<Comment
414-
key={comment.reply_posts_id}
415-
comment={comment}
416-
currentUserId={uid}
417-
// `topicId` and `boardId` are not involved in `comment` here,
418-
// which are necessary for topic reply API.
419-
topicId={this.topicId}
420-
boardId={this.boardId}
421-
navigation={navigation}
422-
getCopyContent={(content) => this.getCopyContent(content)} />
423-
}
417+
renderItem={({ item: comment }) => {
418+
// Same with f227938f.
419+
if (comment.reply_id === 0) {
420+
comment.reply_name = '匿名';
421+
}
422+
return (
423+
<Comment
424+
key={comment.reply_posts_id}
425+
comment={comment}
426+
currentUserId={uid}
427+
// `topicId` and `boardId` are not involved in `comment` here,
428+
// which are necessary for topic reply API.
429+
topicId={this.topicId}
430+
boardId={this.boardId}
431+
navigation={navigation}
432+
getCopyContent={(content) => this.getCopyContent(content)} />
433+
);
434+
}}
424435
onEndReached={() => this.endReached()}
425436
onEndReachedThreshold={0}
426437
ListHeaderComponent={() => this.renderHeader()}

src/services/api.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ export default {
101101
userName,
102102
password
103103
}) => {
104-
return callApi(`user/login&username=${userName}&password=${password}`);
104+
// If we use `application/x-www-form-urlencoded` as `Content-Type`, the body should be
105+
// `key1=value1&key2=value2`, and the specific symbols in value1 and value2 will be treated
106+
// as same as we used them in the query string of GET request. That being said, we should
107+
// encode the values especially do comparing with database.
108+
let body = `username=${encodeURIComponent(userName)}&password=${encodeURIComponent(password)}`;
109+
let fetchOptions = getPublishFetchOptions(body);
110+
return callApi(`user/login`, fetchOptions);
105111
},
106112

107113
fetchTopicList: ({

0 commit comments

Comments
 (0)