-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#292 Load UI lexicon #420
#292 Load UI lexicon #420
Conversation
Thank you for the pull request!The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and iOS rooms once you're in. It'd be great to have you! Maintainer checklist
|
Thanks for this, @Taufi! Really happy to be able to add this feature in :) I'll get to the review today or tomorrow 😊 |
An explanation of the solution: I copy the database to the application support directory, and this operation occurs within the openDBQueue method. This method is utilized to initialize the lazy property languageDB. However, this approach introduces another issue. According to Apple's documentation, a lazy variable isn't inherently thread-safe: "If a property marked with the lazy modifier is accessed by multiple threads simultaneously and the property hasn't yet been initialized, there's no guarantee that the property will be initialized only once." This precisely mirrors the situation here, as the method is executed multiple times, causing unexpected behavior during the database copying process. To address this, I've redefined the languageDB property as a standard (optional) variable and initialized it within the init() method. |
hasToggle: Bool = false, h _: Bool = false, | ||
|
||
hasToggle: Bool = false, | ||
hasNestedNavigation: Bool = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly very confused how this even got through 🤔 Maybe just something from auto save when I was using VS Code to format? Thanks again! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is working beautifully, @Taufi 😊 Thanks so much for the getting to this and also for the explanation of the steps. Made everything much easier to understand 🎉
Hope you have a wonderful weekend! Looking forward to the next issue you pick up :)
Contributor checklist
Description
The UILexicon is unable to load due to the Language Database being located in the app's main bundle, where writing data is not permitted. The solution involves copying the database into the application support directory and accessing it from there.
Additionally, the pull request includes a minor fix for an issue in ParentTableCellModel.
The fix is tested on
The simulator tests are essentially retests because the error doesn't manifest there.
Related issue