Skip to content

Commit d17ca0c

Browse files
committed
Removed PlatformStart and create new file if doesn't exist
1 parent b0e7f96 commit d17ca0c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎app/src/processing/app/Preferences.kt‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import java.util.Properties
1616
constvalPREFERENCES_FILE_NAME="preferences.txt"
1717
constvalDEFAULTS_FILE_NAME="defaults.txt"
1818

19-
funPlatformStart(){
20-
Platform.inst ?:Platform.init()
21-
}
2219
classReactiveProperties: Properties(){
2320
val_stateMap= mutableStateMapOf<String, String>()
2421

@@ -41,10 +38,15 @@ val LocalPreferences = compositionLocalOf<ReactiveProperties>{error("No prefer
4138
@OptIn(FlowPreview::class)
4239
@Composable
4340
funPreferencesProvider(content: @Composable () ->Unit){
44-
PlatformStart()
41+
remember{
42+
Platform.init()
43+
}
4544

4645
val settingsFolder =Platform.getSettingsFolder()
4746
val preferencesFile = settingsFolder.resolve(PREFERENCES_FILE_NAME)
47+
if(!preferencesFile.exists()){
48+
preferencesFile.createNewFile()
49+
}
4850

4951
val update = watchFile(preferencesFile)
5052
val properties = remember(preferencesFile, update){ReactiveProperties().apply{

‎app/src/processing/app/ui/theme/Locale.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class Locale(language: String = "", val setLocale: (java.util.Locale) -> Unit) :
3838
valLocalLocale= compositionLocalOf<Locale>{error("No Locale Set") }
3939
@Composable
4040
funLocaleProvider(content: @Composable () ->Unit){
41-
PlatformStart()
41+
remember{
42+
Platform.init()
43+
}
4244

4345
val settingsFolder =Platform.getSettingsFolder()
4446
val languageFile =File(settingsFolder, "language.txt")

0 commit comments

Comments
(0)