Skip to content

qml: Don't break the emoji keyboard if LocalStorage fails#238

Open
pslldq wants to merge 1 commit intomaliit:masterfrom
pslldq:localstoragefail
Open

qml: Don't break the emoji keyboard if LocalStorage fails#238
pslldq wants to merge 1 commit intomaliit:masterfrom
pslldq:localstoragefail

Conversation

@pslldq
Copy link

@pslldq pslldq commented Nov 1, 2024

Some conditions (like missing access rights to create the database path) may lead the LocalStorage.openDatabaseSync call to fail. This causes the db variable to point to an undefined value, which breaks generating and displaying the list of emojis.

Instead of handling the failed database at every usage, simply provide a bare minimum dummy implementation that doesn't store anything and just returns empty query results. This allows the rest of the code to stay the same.

Some conditions (like missing access rights to create the database
path) may lead the LocalStorage.openDatabaseSync call to fail.
This causes the db variable to point to an undefined value, which
breaks generating and displaying the list of emojis.

Instead of handling the failed database at every usage, simply
provide a bare minimum dummy implementation that doesn't store anything
and just returns empty query results. This allows the rest of the code
to stay the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant