Skip to content

Commit

Permalink
Merge pull request #499 from Bit-Nation/hotfix/1.2.1
Browse files Browse the repository at this point in the history
Hotfix/1.2.1
  • Loading branch information
seland committed Sep 3, 2018
2 parents f2762a0 + e641f6b commit b7fd8df
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ android {
applicationId 'co.bitnation'
minSdkVersion 16
targetSdkVersion 22
versionCode 15
versionName "1.2.0"
versionCode 16
versionName "1.2.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Pangea/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.0</string>
<string>1.2.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>16</string>
<string>17</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Pangea",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
Expand Down
1 change: 1 addition & 0 deletions src/global/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
"newChat": "New Chat",
"invalidKey": "Invalid or Missing Key",
"inviteSent": "Invite Sent",
"dAppMessagePreview": "DApp message...",
"menu": {
"filterChatList": "Filter Chat List",
"markAllRead": "Mark all as read",
Expand Down
11 changes: 9 additions & 2 deletions src/screens/PrivateChat/ChatList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Loading from '../../../components/common/Loading';
import NavigatorComponent from '../../../components/common/NavigatorComponent';
import i18n from '../../../global/i18n';
import Colors from '../../../global/colors';
import type { ProfileType, ChatSessionType } from '../../../types/Chat';
import type { ProfileType, ChatSessionType, GiftedChatMessageType } from '../../../types/Chat';
import type { Navigator } from '../../../types/ReactNativeNavigation';
import ScreenTitle from '../../../components/common/ScreenTitle';
import NewChatModal from './NewChatModal';
Expand Down Expand Up @@ -261,9 +261,16 @@ class ChatListScreen extends NavigatorComponent<Props, State> {
renderItem={(item) => {
const session: ChatSessionType = item.item;
const iconSource = imageSource(session.profile.image) || AssetsImages.avatarIcon;
const messagePreview = ((message: GiftedChatMessageType | null) => {
if (message == null) return null;
if (message.dAppMessage == null) return message.text;

// @todo Add preview for DApp messages.
return i18n.t('screens.chat.dAppMessagePreview');
})(session.messages.length === 0 ? null : session.messages[session.messages.length - 1]);
return (<ChatListItem
name={session.profile.name}
lastMessage={session.messages.length === 0 ? null : session.messages[session.messages.length - 1].text}
lastMessage={messagePreview}
avatar={iconSource}
onPress={this.onChatSelect}
unreadMessages={session.unreadMessages}
Expand Down
12 changes: 6 additions & 6 deletions src/types/DApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ export type DApp = {
}

export type PanthalassaDApp = {
name: { [string]: string },
code: string,
used_signing_key: string,
signature: string,
engine: {
Name: { [string]: string },
Code: string,
UsedSigningKey: string,
Signature: string,
Engine: {
major: number,
minor: number,
patch: number,
},
version: number,
Version: number,
}

export type DAppModalInfo = {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export function createGiftedChatMessageObjects(sender: Account, receiver: Profil
try {
const dAppMessageJSON = JSON.parse(data.dapp);
dAppMessage = {
dAppPublicKey: Buffer.from(dAppMessageJSON.dapp_public_key, 'base64').toString('hex'),
params: dAppMessageJSON.params,
shouldSend: dAppMessageJSON.should_send,
type: dAppMessageJSON.type,
dAppPublicKey: Buffer.from(dAppMessageJSON.DAppPublicKey, 'base64').toString('hex'),
params: dAppMessageJSON.Params,
shouldSend: dAppMessageJSON.ShouldSend,
type: dAppMessageJSON.Type,
};
} catch (error) {
console.log(`[CHAT] Unable to parse DApp message: ${data.dapp}`);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/mapping/dapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import type { DApp, PanthalassaDApp } from '../../types/DApp';
* @return {Object} Converted DApp object.
*/
export function convertFromPanthalassa(dApp: PanthalassaDApp, locale: string = 'en-us'): DApp {
const hexPublicKey = Buffer.from(dApp.used_signing_key, 'base64').toString('hex');
const hexPublicKey = Buffer.from(dApp.UsedSigningKey, 'base64').toString('hex');
return {
name: dApp.name[locale] || dApp.name['en-us'],
name: dApp.Name[locale] || dApp.Name['en-us'],
publicKey: hexPublicKey,
};
}

0 comments on commit b7fd8df

Please sign in to comment.