Skip to content

Commit

Permalink
Merge branch 'main' into j-s/deadline-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jun 26, 2024
2 parents 8c0493d + 11e9ede commit 7c534d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions apps/native/app/src/utils/lifecycle/setup-event-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -25,6 +24,8 @@ import { isIos } from '../devices'
import { handleQuickAction } from '../quick-actions'

let backgroundAppLockTimeout: ReturnType<typeof setTimeout>
// Flag to track overlay state
let overlayShown = false

export function setupEventHandlers() {
// Listen for url events through iOS and Android's Linking library
Expand Down Expand Up @@ -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 })
}
}
Expand All @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const titleTemplate = (title?: string, date?: string, locale = 'is') => {
return `
<p class="signature__title">${title}${title && date ? ', ' : ''}${
date
? format(new Date(date), 'dd. MMMM yyyy', {
? format(new Date(date), 'd. MMMM yyyy', {
locale: locale === 'is' ? is : en,
})
: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { useS3Upload } from '../utils/dataHooks'

const defaultSignatureText = `
<p class="Dags" align="center"><em>{ministry}nu, {dags}.</em></p>
<p class="FHUndirskr" align="center">f.h.r.</p>
<p class="FHUndirskr" align="center">F.h.r.</p>
<p class="Undirritun" align="center"><strong>NAFN</strong></p>
<p class="Undirritun" align="right"><em>NAFN.</em></p>
` as HTMLText
Expand Down

0 comments on commit 7c534d5

Please sign in to comment.