aboutsummaryrefslogtreecommitdiff
path: root/webAO/client
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/client')
-rw-r--r--webAO/client/aoHost.ts9
-rw-r--r--webAO/client/appendICLog.ts6
2 files changed, 11 insertions, 4 deletions
diff --git a/webAO/client/aoHost.ts b/webAO/client/aoHost.ts
index 6cad62a..33e010d 100644
--- a/webAO/client/aoHost.ts
+++ b/webAO/client/aoHost.ts
@@ -3,5 +3,14 @@ import queryParser from '../utils/queryParser'
const { asset } = queryParser();
export let AO_HOST = asset;
export const setAOhost = (val: string) => {
+ const currentProtocol = window.location.protocol;
+ const assetProtocol = val.split(':')[0] + ':';
+
+ if (currentProtocol === 'https:' && assetProtocol === 'http:') {
+ // In this specific case, we need to request assets over HTTPS
+ console.log('Upgrading asset link to https');
+ val = val.replace('http:', 'https:');
+ }
+
AO_HOST = val;
}
diff --git a/webAO/client/appendICLog.ts b/webAO/client/appendICLog.ts
index f8b7852..307009c 100644
--- a/webAO/client/appendICLog.ts
+++ b/webAO/client/appendICLog.ts
@@ -48,10 +48,8 @@ export function appendICLog(
const clientLog = document.getElementById("client_log")!;
clientLog.appendChild(entry);
- /* This is a little buggy - some troubleshooting might be desirable */
- if (clientLog.scrollTop > clientLog.scrollHeight - 800) {
- clientLog.scrollTop = clientLog.scrollHeight;
- }
+ if (clientLog.scrollTop+clientLog.offsetHeight+120>clientLog.scrollHeight)
+ clientLog.scrollTo(0, clientLog.scrollHeight);
setLastICMessageTime(new Date());
} \ No newline at end of file