getFSInfo changed to use JS serializable WritableMap instead of HashMap

This commit is contained in:
Chris Dell 2016-05-03 21:35:14 +01:00
parent 33d637e42e
commit 01d43a011a

View File

@ -315,9 +315,9 @@ public class RNFSManager extends ReactContextBaseJavaModule {
totalSpace = blockSize * stat.getBlockCount();
freeSpace = blockSize * stat.getAvailableBlocks();
}
HashMap info = new HashMap();
info.put("totalSpace", totalSpace);
info.put("freeSpace", freeSpace);
WritableMap info = Arguments.createMap();
info.putDouble("totalSpace", (double)totalSpace); // Int32 too small, must use Double
info.putDouble("freeSpace", (double)freeSpace);
callback.invoke(null, info);
}