diff options
| author | Leon Krause | 2017-10-02 16:09:24 +0200 |
|---|---|---|
| committer | Leon Krause | 2017-10-02 21:07:05 +0200 |
| commit | 7b23665e728fe10cd0eedb54824aaeae4ae23758 (patch) | |
| tree | 289ef1982791cba4c35cc0de331083170c0b18b4 /platform/javascript/javascript_main.cpp | |
| parent | 66987d687879017affb787b4a3ffb1ef11880336 (diff) | |
| download | godot-7b23665e728fe10cd0eedb54824aaeae4ae23758.tar.gz godot-7b23665e728fe10cd0eedb54824aaeae4ae23758.tar.zst godot-7b23665e728fe10cd0eedb54824aaeae4ae23758.zip | |
Diffstat (limited to 'platform/javascript/javascript_main.cpp')
| -rw-r--r-- | platform/javascript/javascript_main.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index 4c948bf18..ed4f416cf 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -39,8 +39,13 @@ static void main_loop() { os->main_loop_iterate(); } -extern "C" void main_after_fs_sync() { +extern "C" void main_after_fs_sync(char *p_idbfs_err) { + String idbfs_err = String::utf8(p_idbfs_err); + if (!idbfs_err.empty()) { + print_line("IndexedDB not available: " + idbfs_err); + } + os->set_idbfs_available(idbfs_err.empty()); // Ease up compatibility ResourceLoader::set_abort_on_missing_resources(false); Main::start(); @@ -60,14 +65,7 @@ int main(int argc, char *argv[]) { FS.mkdir('/userfs'); FS.mount(IDBFS, {}, '/userfs'); FS.syncfs(true, function(err) { - if (err) { - Module.setStatus('Failed to load persistent data\nPlease allow (third-party) cookies'); - Module.printErr('Failed to populate IDB file system: ' + err.message); - Module.noExitRuntime = false; - } else { - Module.print('Successfully populated IDB file system'); - ccall('main_after_fs_sync', null); - } + Module['ccall']('main_after_fs_sync', null, ['string'], [err ? err.message : ""]) }); ); /* clang-format on */ |
