Skip to content

Commit

Permalink
When importing configs via link, don't show dialog twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ImranR98 committed Dec 12, 2024
1 parent d5d6825 commit 523e115
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,18 @@ class _HomePageState extends State<HomePage> {

// Check initial link if app was in cold state (terminated)
final appLink = await _appLinks.getInitialLink();
var initLinked = false;
if (appLink != null) {
await interpretLink(appLink);
initLinked = true;
}

// Handle link when app is in warm state (front or background)
_linkSubscription = _appLinks.uriLinkStream.listen((uri) async {
await interpretLink(uri);
if (!initLinked) {
await interpretLink(uri);
} else {
initLinked = false;
}
});
}

Expand Down

0 comments on commit 523e115

Please sign in to comment.