fix wrong filename for customized json layouts

This commit is contained in:
Helium314 2024-03-12 14:14:16 +01:00
parent 29a4bb4558
commit c29eb0d03e

View file

@ -159,7 +159,7 @@ fun editCustomLayout(layoutName: String, context: Context, startContent: String?
file.parentFile?.mkdir() file.parentFile?.mkdir()
file.writeText(content) file.writeText(content)
if (isJson != wasJson) // unlikely to be needed, but better be safe if (isJson != wasJson) // unlikely to be needed, but better be safe
file.renameTo(File(file.absolutePath.substringBeforeLast(".") + if (isJson) "json" else "txt")) file.renameTo(File(file.absolutePath.substringBeforeLast(".") + "." + if (isJson) "json" else "txt"))
KeyboardSwitcher.getInstance().forceUpdateKeyboardTheme(context) KeyboardSwitcher.getInstance().forceUpdateKeyboardTheme(context)
} }
} }