Commit 17b9e57b by Kim Peace Committed by onuma

Fixed parse bool and string

parent ad2ba6d3
...@@ -15,6 +15,10 @@ function callNativeApp(iosKey, jsonData) { ...@@ -15,6 +15,10 @@ function callNativeApp(iosKey, jsonData) {
return result; return result;
} }
function parseBoolStringToBool(str) {
return str == "true" ? true : false;
}
var NativeBridgeDataSource = {}; var NativeBridgeDataSource = {};
NativeBridgeDataSource.removeFavoriteGroup = function (groupID) { NativeBridgeDataSource.removeFavoriteGroup = function (groupID) {
...@@ -22,7 +26,7 @@ NativeBridgeDataSource.removeFavoriteGroup = function (groupID) { ...@@ -22,7 +26,7 @@ NativeBridgeDataSource.removeFavoriteGroup = function (groupID) {
const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, { const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupID, groupId: groupID,
}); });
return result == "true" ? true : false; return parseBoolStringToBool(result);
} else { } else {
return android.removeFavoriteGroup(groupID); return android.removeFavoriteGroup(groupID);
} }
...@@ -35,11 +39,7 @@ NativeBridgeDataSource.addFavoriteGroup = function (groupID) { ...@@ -35,11 +39,7 @@ NativeBridgeDataSource.addFavoriteGroup = function (groupID) {
const result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, { const result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupID, groupId: groupID,
}); });
if (result == "true") { return parseBoolStringToBool(result);
return true;
} else {
return false;
}
} }
}; };
...@@ -352,14 +352,10 @@ NativeBridgeDataSource.getBeforeRoomType = function () { ...@@ -352,14 +352,10 @@ NativeBridgeDataSource.getBeforeRoomType = function () {
NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) { NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, { const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId, shopMemberId: shopMemberId,
}); });
if (result == "true") { return parseBoolStringToBool(result);
return true;
} else {
return false;
}
} else { } else {
return android.removeFavoriteUser(shopMemberId); return android.removeFavoriteUser(shopMemberId);
} }
...@@ -367,14 +363,10 @@ NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) { ...@@ -367,14 +363,10 @@ NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) {
NativeBridgeDataSource.addFavoriteUser = function (shopMemberId) { NativeBridgeDataSource.addFavoriteUser = function (shopMemberId) {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, { const result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId, shopMemberId: shopMemberId,
}); });
if (result == "true") { return parseBoolStringToBool(result);
return true;
} else {
return false;
}
} else { } else {
return android.addFavoriteUser(shopMemberId); return android.addFavoriteUser(shopMemberId);
} }
...@@ -391,8 +383,6 @@ NativeBridgeDataSource.getJoinCollaborationType = function () { ...@@ -391,8 +383,6 @@ NativeBridgeDataSource.getJoinCollaborationType = function () {
} }
}; };
NativeBridgeDataSource.getUserInfoList = function (shopMemberId) { NativeBridgeDataSource.getUserInfoList = function (shopMemberId) {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, { return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
...@@ -425,4 +415,4 @@ NativeBridgeDataSource.getHostRequestFlg = function () { ...@@ -425,4 +415,4 @@ NativeBridgeDataSource.getHostRequestFlg = function () {
} else { } else {
return android.getHostRequestFlg(); return android.getHostRequestFlg();
} }
}; };
\ No newline at end of file
...@@ -270,7 +270,7 @@ NativeBridgeDelegate.updateMessages = function (roomID) { ...@@ -270,7 +270,7 @@ NativeBridgeDelegate.updateMessages = function (roomID) {
NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") { NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({ webkit.messageHandlers.roomInfoSaveMessageHandlerId.postMessage({
roomId: roomID, roomId: roomID,
roomName: roomName, roomName: roomName,
}); });
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy"
onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton"> onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star active shopmember_890" onclick="CHAT_UI.favoriteUserChange(890,this)"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange('{{shopMemberId}}',this)"></span>
<span>お気に入り解除</span> <span>お気に入り解除</span>
</div> </div>
</button> </button>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy"
onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton"> onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star disable shopmember_3690" onclick="Namecard.favoriteUserChange(3690,this)"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange('{{shopMemberId}}',this)"></span>
<span>お気に入り登録</span> <span>お気に入り登録</span>
</div> </div>
</button> </button>
......
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