Skip to content

Fix for TOTP codes not updating when the views disappeared #162

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

jdmoreira
Copy link
Member

@jdmoreira jdmoreira commented May 8, 2025

Motivation

There was a bug where when the SwiftUI View disappeared from the view hierarchy we would destroy the timer and invalidate the account. On long lists of TOTP codes this was a problem since each view will disappear from the view hierarchy when the user scrolls up and down.

Changes

  • Use a single static timer for all updates since we only need to trigger once per seconds independently of each individual TOPT
  • Improve the animation for the pie indicator since when the view re-entered the view hierarchy it would interpolate more then 1s and it would look strange

Copy link
Member

@AdamVe AdamVe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the issue, tested on device.

@jdmoreira jdmoreira self-assigned this May 9, 2025
@jdmoreira jdmoreira merged commit c831f9d into main May 9, 2025
1 check failed
@jdmoreira jdmoreira deleted the fix/CRI-678 branch May 9, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants