Android: fix app hanging on the loading screen (Node start only returns when Node exits, wait for whenReady instead), build the native bridge with 16 KB page alignment, show an error instead of an endless spinner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,8 +26,10 @@ ipcMain.on('dev:send', (_e, name, args) => fromWeb.emit(name, ...args));
|
||||
ipcMain.handle('dev:start', (_e, env) => {
|
||||
Object.assign(process.env, env, { DATADIR: bridge.getDataPath() });
|
||||
require('fs').mkdirSync(process.env.DATADIR, { recursive: true });
|
||||
require(path.join(WWW, 'nodejs', 'index.js'));
|
||||
setTimeout(() => { started = true; require(path.join(WWW, 'nodejs', 'index.js')); }, 500);
|
||||
});
|
||||
let started;
|
||||
ipcMain.handle('dev:ready', async () => { while (!started) await new Promise((r) => setTimeout(r, 100)); });
|
||||
ipcMain.handle('dev:native', (_e, method, arg) => {
|
||||
if (method === 'vaultKey') return { key: crypto.createHash('sha256').update(app.getPath('userData')).digest('base64') };
|
||||
if (method === 'info') return { device: 'Dev Phone', locale: process.env.MRTERM_DEV_LOCALE || 'en-US', version: require('../../package.json').version };
|
||||
|
||||
Reference in New Issue
Block a user