fix(mobile): translation hydration

This commit is contained in:
Stephen Zhou 2025-06-04 09:52:27 +08:00
parent c601752e55
commit 113cb6d886
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ class TranslationServiceStatic implements Resetable {
// Remove translations created before the last 7 days
const translationsToClean = translations.filter(
(translation) =>
new Date(translation.createdAt) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date(translation.createdAt) < new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
)
await db.delete(translationsTable).where(
inArray(

View File

@ -30,8 +30,8 @@ class TranslationActions implements Hydratable {
}
upsertManyInSession(translations: TranslationModel[]) {
translations.forEach((translation) => {
immerSet((state) => {
immerSet((state) => {
translations.forEach((translation) => {
if (!state.data[translation.entryId]) {
state.data[translation.entryId] = {}
}