feat(KAN-53): add Android app and platform integration
This commit is contained in:
@@ -16,6 +16,8 @@ export const en = {
|
||||
connecting: 'Connecting to your server…',
|
||||
connected:
|
||||
'Your workspace is open. Use KanbanGit → Server settings to change servers.',
|
||||
connectedMobile:
|
||||
'Your workspace is open. Use Server settings to change servers.',
|
||||
connectionError:
|
||||
'The server did not finish loading. Check your connection, server address and HTTPS certificate, then try again. An already open workspace and its inputs are kept.',
|
||||
invalidServer:
|
||||
|
||||
+15
-2
@@ -20,7 +20,11 @@ function action(name, server) {
|
||||
if (server) {
|
||||
url.searchParams.set('server', server);
|
||||
}
|
||||
location.href = url.href;
|
||||
if (window.nativeLauncher) {
|
||||
window.nativeLauncher.postMessage(url.href);
|
||||
} else {
|
||||
location.href = url.href;
|
||||
}
|
||||
}
|
||||
|
||||
window.updateLauncher = (query) => {
|
||||
@@ -34,7 +38,12 @@ window.updateLauncher = (query) => {
|
||||
if (phase === 'connecting' || phase === 'connected') {
|
||||
activeServer = server;
|
||||
}
|
||||
status.textContent = en[phase] ?? '';
|
||||
status.textContent =
|
||||
en[
|
||||
phase === 'connected' && state.get('platform') === 'android'
|
||||
? 'connectedMobile'
|
||||
: phase
|
||||
] ?? '';
|
||||
status.dataset.state = phase;
|
||||
open.disabled = phase === 'connecting';
|
||||
open.textContent =
|
||||
@@ -85,3 +94,7 @@ resume.addEventListener('click', () => action('resume'));
|
||||
document.querySelector('#appearance').addEventListener('change', (event) => {
|
||||
document.documentElement.dataset.appearance = event.target.value;
|
||||
});
|
||||
|
||||
if (window.nativeLauncher) {
|
||||
action('ready');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user