mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
Web: Show error in chat if fail to sync filesystem to IndexedDB
This commit is contained in:
parent
9c2b28ca88
commit
b1dcb4da41
@ -1731,6 +1731,12 @@ void Platform_Init(void) {
|
||||
Platform_InitSpecific();
|
||||
}
|
||||
#elif defined CC_BUILD_WEB
|
||||
EMSCRIPTEN_KEEPALIVE void Platform_LogError(const char* msg) {
|
||||
/* no pointer showing more than 128 characters in chat */
|
||||
cc_string str = String_FromRaw(msg, 128);
|
||||
Logger_WarnFunc(&str);
|
||||
}
|
||||
|
||||
extern void interop_InitModule(void);
|
||||
extern void interop_GetIndexedDBError(char* buffer);
|
||||
void Platform_Init(void) {
|
||||
|
@ -127,7 +127,14 @@ void interop_GetIndexedDBError(char* buffer) {
|
||||
}
|
||||
|
||||
void interop_SyncFS(void) {
|
||||
EM_ASM( FS.syncfs(false, function(err) { if (err) console.log(err); }); );
|
||||
EM_ASM({
|
||||
FS.syncfs(false, function(err) {
|
||||
if (!err) return;
|
||||
console.log(err);
|
||||
ccall('Platform_LogError', 'void', ['string'], ['&cError saving IndexedDB:']);
|
||||
ccall('Platform_LogError', 'void', ['string'], [' &c' + err]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
int interop_OpenTab(const char* url) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user