diff --git a/app/src/processing/app/Preferences.kt b/app/src/processing/app/Preferences.kt index 8a9dc0f7d..7bfadcd73 100644 --- a/app/src/processing/app/Preferences.kt +++ b/app/src/processing/app/Preferences.kt @@ -16,9 +16,6 @@ import java.util.Properties const val PREFERENCES_FILE_NAME = "preferences.txt" const val DEFAULTS_FILE_NAME = "defaults.txt" -fun PlatformStart(){ - Platform.inst ?: Platform.init() -} class ReactiveProperties: Properties() { val _stateMap = mutableStateMapOf() @@ -41,10 +38,15 @@ val LocalPreferences = compositionLocalOf { error("No prefer @OptIn(FlowPreview::class) @Composable fun PreferencesProvider(content: @Composable () -> Unit){ - PlatformStart() + remember { + Platform.init() + } val settingsFolder = Platform.getSettingsFolder() val preferencesFile = settingsFolder.resolve(PREFERENCES_FILE_NAME) + if(!preferencesFile.exists()){ + preferencesFile.createNewFile() + } val update = watchFile(preferencesFile) val properties = remember(preferencesFile, update) { ReactiveProperties().apply { diff --git a/app/src/processing/app/ui/theme/Locale.kt b/app/src/processing/app/ui/theme/Locale.kt index 1f0197d56..a4fd9eecf 100644 --- a/app/src/processing/app/ui/theme/Locale.kt +++ b/app/src/processing/app/ui/theme/Locale.kt @@ -38,7 +38,9 @@ class Locale(language: String = "", val setLocale: (java.util.Locale) -> Unit) : val LocalLocale = compositionLocalOf { error("No Locale Set") } @Composable fun LocaleProvider(content: @Composable () -> Unit) { - PlatformStart() + remember { + Platform.init() + } val settingsFolder = Platform.getSettingsFolder() val languageFile = File(settingsFolder, "language.txt")