From 39bafab732e06a0323b46c30e3e4e0bc590cc49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sn=C3=A6r=20Seljan=20=C3=9E=C3=B3roddsson?= <112904566+snaerseljan@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:15:33 +0000 Subject: [PATCH 1/2] fix(native-app): Fix app lock biometrics race condition (#15361) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/utils/lifecycle/setup-event-handlers.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/native/app/src/utils/lifecycle/setup-event-handlers.ts b/apps/native/app/src/utils/lifecycle/setup-event-handlers.ts index 10ff519a4022..ad558c4a7b0f 100644 --- a/apps/native/app/src/utils/lifecycle/setup-event-handlers.ts +++ b/apps/native/app/src/utils/lifecycle/setup-event-handlers.ts @@ -11,7 +11,6 @@ import SpotlightSearch from 'react-native-spotlight-search' import { evaluateUrl, navigateTo } from '../../lib/deep-linking' import { authStore } from '../../stores/auth-store' import { environmentStore } from '../../stores/environment-store' -import { notificationsStore } from '../../stores/notifications-store' import { offlineStore } from '../../stores/offline-store' import { preferencesStore } from '../../stores/preferences-store' import { uiStore } from '../../stores/ui-store' @@ -25,6 +24,8 @@ import { isIos } from '../devices' import { handleQuickAction } from '../quick-actions' let backgroundAppLockTimeout: ReturnType +// Flag to track overlay state +let overlayShown = false export function setupEventHandlers() { // Listen for url events through iOS and Android's Linking library @@ -102,16 +103,19 @@ export function setupEventHandlers() { // Add a small delay for those accidental backgrounds in iOS backgroundAppLockTimeout = setTimeout(() => { const { lockScreenComponentId } = authStore.getState() - if (!lockScreenComponentId) { + + if (!lockScreenComponentId && !overlayShown) { + overlayShown = true showAppLockOverlay({ status }) - } else { + } else if (lockScreenComponentId) { Navigation.updateProps(lockScreenComponentId, { status }) } }, 100) } else { - if (!lockScreenComponentId) { + if (!lockScreenComponentId && !overlayShown) { + overlayShown = true showAppLockOverlay({ status }) - } else { + } else if (lockScreenComponentId) { Navigation.updateProps(lockScreenComponentId, { status }) } } @@ -127,9 +131,12 @@ export function setupEventHandlers() { lockScreenActivatedAt + appLockTimeout > Date.now() ) { hideAppLockOverlay(lockScreenComponentId) + overlayShown = false // Mark overlay as hidden } else { Navigation.updateProps(lockScreenComponentId, { status }) } + } else { + overlayShown = false // Reset overlay state if no lock screen component } } } From 11e9ede04cf7f9a00a0d65c1a94cc8dfe7759f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3r=C3=B0ur=20H?= Date: Wed, 26 Jun 2024 14:09:47 +0000 Subject: [PATCH 2/2] fix(regulations-admin): Signature formatting (#15362) --- .../src/components/htmlEditor/templates/signatures.ts | 2 +- .../admin/regulations-admin/src/components/EditSignature.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/templates/signatures.ts b/libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/templates/signatures.ts index 08425fb533f6..b964b5c5dfe7 100644 --- a/libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/templates/signatures.ts +++ b/libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/templates/signatures.ts @@ -51,7 +51,7 @@ const titleTemplate = (title?: string, date?: string, locale = 'is') => { return `

${title}${title && date ? ', ' : ''}${ date - ? format(new Date(date), 'dd. MMMM yyyy', { + ? format(new Date(date), 'd. MMMM yyyy', { locale: locale === 'is' ? is : en, }) : '' diff --git a/libs/portals/admin/regulations-admin/src/components/EditSignature.tsx b/libs/portals/admin/regulations-admin/src/components/EditSignature.tsx index a0eaf00f51d1..85e7a814302d 100644 --- a/libs/portals/admin/regulations-admin/src/components/EditSignature.tsx +++ b/libs/portals/admin/regulations-admin/src/components/EditSignature.tsx @@ -28,7 +28,7 @@ import { useS3Upload } from '../utils/dataHooks' const defaultSignatureText = `

{ministry}nu, {dags}.

-

f.h.r.

+

F.h.r.

NAFN

NAFN.

` as HTMLText