Every minute it checks if available disk space < 1 GB.
It requires new module - diskspace - works on Windows Linux and Mac.
Tested only on Linux.
If the partition where Rambox is running from has < 1 GB available space:
- a warning dialog appears and Rambox freezes (synchronous dialog).
Dialog has info about:
-- remaining space
-- rambox/electron installation path
-- instruction to free up more space and that the app will exit upon dialog dismissal
-- OK button which quits Rambox
No matter how the dialog is dismissed, Rambox quits.
// optionally render this information also in rambox window
try{
const{available}=awaitdisk.check(appPath);
if(available<1073741824){// 1 GB
constoptions={
type:'warning',
buttons:['OK, quit'],
defaultId:0,
title:`Running out of disk space! - Rambox shutting down`,
detail:`You've got just ${formatBytes(available)} space left.\n\nRambox has been frozen to prevent settings corruption.\n\nOnce you quit this dialog, Rambox will shutdown.\n\n1 GB of avalable disk space is required.\nFree up space on partition where Rambox is installed then start the app again.\n\nRambox path: \n${appPath}`,
message:`Running out of disk space! - Rambox shutting down`,