fixed settings file read error

This commit is contained in:
Odweta
2024-11-30 12:15:36 +01:00
parent 5a98379d3f
commit 4d96707a51
@@ -61,7 +61,8 @@ fun fetchNewData(ctx: Context, coscope: CoroutineScope) {
val role = if (Parsing.userIsParent()) { val role = if (Parsing.userIsParent()) {
" Rodič" " Rodič"
} else { } else {
" Student" //TODO: remove
" Student #############################################"
} }
// display the full name of the user in the toolbar // display the full name of the user in the toolbar
@@ -166,7 +167,9 @@ private suspend fun launchPhase1(ctx: Context) {
marks = Parsing.parseMarksJSON(marksJSON) marks = Parsing.parseMarksJSON(marksJSON)
// set the settings // set the settings
settingsData = Util.stringToSettingsData(Util.fileToString(settingsDataFilePath)) if (Util.fileExists(settingsDataFilePath) && !Util.fileIsEmpty(settingsDataFilePath)) {
settingsData = Util.stringToSettingsData(Util.fileToString(settingsDataFilePath))
} // else load the default settigns
// continue to launch phase 2 // continue to launch phase 2
done = true done = true