Commit 5d766b13 by Kim Peace

Merge branch 'bug/offline' into 'develop'

Bug/offline

See merge request !240
parents 63262cab 9959fead
......@@ -111,6 +111,9 @@ Common.refreshForOnline = function () {
if (typeof Namecard != "undefined") {
Namecard.refreshForOnline();
}
if (document.readyState == "complete") {
Common.dismissLoadingIndicator();
}
};
Common.refreshForOffline = function () {
......@@ -137,19 +140,31 @@ Common.getProfileImgUrl = function (path) {
return "./img/noImage.png";
} else if (path.includes("/mnt")) {
const userInfo = path.split("/").reverse();
if (deviceInfo.isiOS()) {
const receivedString = NativeBridgeDataSource.getCachedImage(userInfo[1]);
if (receivedString == "" || receivedString == undefined) {
return Common.generateProfileImgURLFromServer(userInfo[0], userInfo[1]);
}
return "data:image/"+userInfo[0].split('.').pop()+";base64," + receivedString;
}
return Common.generateProfileImgURLFromServer(userInfo[0], userInfo[1]);
} else {
return path;
}
};
Common.generateProfileImgURLFromServer = function (fileName, loginID) {
return (
serverInfo.cmsURL +
"/chatapi/user?profileFileName=" +
userInfo[0] +
fileName +
"&profileGetLoginId=" +
userInfo[1] +
loginID +
"&sid=" +
currentUserInfo.sid +
"&cmd=12"
);
} else {
return path;
}
};
Common.startCollaboration = function (collaborationType) {
......
......@@ -190,6 +190,7 @@ const NATIVE_KEY_IOS = {
getUserListByLoginId: "getUserListByLoginId",
getMessageListFromMessageId: "getMessageListFromMessageId",
updatePreMessage: "updatePreMessage",
getCachedImage: "getCachedImage",
};
const BIZ_TASK_YELL_URL = "https://biztaskyell.abookcloud.com";
......@@ -416,3 +416,9 @@ NativeBridgeDataSource.getHostRequestFlg = function () {
return android.getHostRequestFlg();
}
};
NativeBridgeDataSource.getCachedImage = function (loginID) {
if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCachedImage, { loginID: loginID });
}
};
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