Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Merge requests
!112
Restore contacts from backup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Restore contacts from backup
feature/restore-contacts-from-backup
into
development
Overview
0
Commits
26
Pipelines
0
Changes
1
Merged
Dariusz Rybicki
requested to merge
feature/restore-contacts-from-backup
into
development
2 years ago
Overview
0
Commits
26
Pipelines
0
Changes
1
Expand
XXClient library
Improve error handling in
UdMultiLookupCallback
.
xx-messenger example
Improve backup restoration.
Restore contacts.
Add contact lookup feature.
Display contact ids.
Improve sending requests.
Restore username from restored facts, not from restored params.
Edited
2 years ago
by
Dariusz Rybicki
0
0
Merge request reports
Viewing commit
618eae31
Prev
Next
Show latest version
1 file
+
10
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
618eae31
Show failure in ContactLookupView
· 618eae31
Dariusz Rybicki
authored
2 years ago
Examples/xx-messenger/Sources/ContactLookupFeature/ContactLookupView.swift
0 → 100644
+
76
−
0
Options
import
AppCore
import
ComposableArchitecture
import
SwiftUI
public
struct
ContactLookupView
:
View
{
public
init
(
store
:
Store
<
ContactLookupState
,
ContactLookupAction
>
)
{
self
.
store
=
store
}
let
store
:
Store
<
ContactLookupState
,
ContactLookupAction
>
struct
ViewState
:
Equatable
{
init
(
state
:
ContactLookupState
)
{
id
=
state
.
id
isLookingUp
=
state
.
isLookingUp
failure
=
state
.
failure
}
var
id
:
Data
var
isLookingUp
:
Bool
var
failure
:
String
?
}
public
var
body
:
some
View
{
WithViewStore
(
store
,
observe
:
ViewState
.
init
)
{
viewStore
in
Form
{
Section
{
Label
(
viewStore
.
id
.
hexString
(),
systemImage
:
"number"
)
.
font
(
.
footnote
.
monospaced
())
Button
{
viewStore
.
send
(
.
lookupTapped
)
}
label
:
{
HStack
{
Text
(
"Lookup"
)
Spacer
()
if
viewStore
.
isLookingUp
{
ProgressView
()
}
else
{
Image
(
systemName
:
"magnifyingglass"
)
}
}
}
.
disabled
(
viewStore
.
isLookingUp
)
}
header
:
{
Text
(
"Contact ID"
)
}
if
let
failure
=
viewStore
.
failure
{
Section
{
Text
(
failure
)
}
header
:
{
Text
(
"Error"
)
}
}
}
.
navigationTitle
(
"Lookup"
)
}
}
}
#if DEBUG
public
struct
ContactLookupView_Previews
:
PreviewProvider
{
public
static
var
previews
:
some
View
{
NavigationView
{
ContactLookupView
(
store
:
Store
(
initialState
:
ContactLookupState
(
id
:
"1234"
.
data
(
using
:
.
utf8
)
!
),
reducer
:
.
empty
,
environment
:
()
))
}
}
}
#endif
Loading