Skip to content

Commit

Permalink
Run format swift and rust
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Dec 9, 2024
1 parent bc99113 commit 419cd28
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
38 changes: 19 additions & 19 deletions ios/Cove/CoveApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct SafeAreaInsetsKey: EnvironmentKey {
}
}

extension EnvironmentValues {
public var safeAreaInsets: EdgeInsets {
public extension EnvironmentValues {
var safeAreaInsets: EdgeInsets {
self[SafeAreaInsetsKey.self]
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ struct CoveApp: App {
):
"The address \(address) is on the wrong network. You are on \(currentNetwork), and the address was for \(network)."
case let .noWalletSelected(address),
let .foundAddress(address, _):
let .foundAddress(address, _):
String(address)
case .noCameraPermission:
"Please allow camera access in Settings to use this feature."
Expand All @@ -95,11 +95,11 @@ struct CoveApp: App {
try? manager.rust.selectWallet(id: walletId)
}
case .invalidWordGroup,
.errorImportingHotWallet,
.importedSuccessfully,
.unableToSelectWallet,
.errorImportingHardwareWallet,
.invalidFileFormat:
.errorImportingHotWallet,
.importedSuccessfully,
.unableToSelectWallet,
.errorImportingHardwareWallet,
.invalidFileFormat:
Button("OK") {
manager.alertState = .none
}
Expand Down Expand Up @@ -442,20 +442,20 @@ struct CoveApp: App {
.gesture(
manager.router.routes.isEmpty
? DragGesture()
.onChanged { gesture in
if gesture.startLocation.x < 25, gesture.translation.width > 100 {
withAnimation(.spring()) {
manager.isSidebarVisible = true
}
.onChanged { gesture in
if gesture.startLocation.x < 25, gesture.translation.width > 100 {
withAnimation(.spring()) {
manager.isSidebarVisible = true
}
}
.onEnded { gesture in
if gesture.startLocation.x < 20, gesture.translation.width > 50 {
withAnimation(.spring()) {
manager.isSidebarVisible = true
}
}
.onEnded { gesture in
if gesture.startLocation.x < 20, gesture.translation.width > 50 {
withAnimation(.spring()) {
manager.isSidebarVisible = true
}
} : nil
}
} : nil
)
.task {
await manager.rust.initOnStart()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ struct HotWalletImportScreen: View {
do {
let multiQr: MultiQr =
try multiQr
?? {
let newMultiQr = try MultiQr.tryNew(qr: qr)
self.multiQr = newMultiQr
return newMultiQr
}()
?? {
let newMultiQr = try MultiQr.tryNew(qr: qr)
self.multiQr = newMultiQr
return newMultiQr
}()

// see if its single qr or seed qr
if let words = try multiQr.getGroupedWords(qr: qr, groupsOf: UInt8(6)) {
Expand Down Expand Up @@ -175,8 +175,7 @@ struct HotWalletImportScreen: View {
outerIndex = outerIndex - 1
}

if innerIndex > 5 || outerIndex > lastIndex || outerIndex < 0 || innerIndex < 0
{
if innerIndex > 5 || outerIndex > lastIndex || outerIndex < 0 || innerIndex < 0 {
Log.error(
"Something went wrong: innerIndex: \(innerIndex), outerIndex: \(outerIndex), lastIndex: \(lastIndex), focusField: \(focusField)"
)
Expand Down Expand Up @@ -367,7 +366,7 @@ struct HotWalletImportScreen: View {
// if its the last word on the non last card and all words are valid words, then go to next tab
// focusField will already have changed by now
if let focusField,
!buttonIsDisabled, tabIndex < lastIndex, focusField % 6 == 1
!buttonIsDisabled, tabIndex < lastIndex, focusField % 6 == 1
{
withAnimation {
tabIndex += 1
Expand Down Expand Up @@ -607,7 +606,7 @@ private struct AutocompleteField: View {
// then auto select the first selection, because we want auto selection
// but also allow the user to fix a wrong word
if let word = filteredSuggestions.last,
filteredSuggestions.count == 1, oldText.count < newText.count
filteredSuggestions.count == 1, oldText.count < newText.count
{
state = .valid
filteredSuggestions = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ struct VerifyWordsScreen: View {
.spring().speed(3),
completion: {
incorrectGuesses += 1
})
}
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Cove/Flows/NewWalletFlow/PendingWalletViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// PendingWalletManager.swift
// PendingWalletViewModel.swift
// Cove
//
// Created by Praveen Perera on 6/18/24.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ struct SelectedWalletScreen: View {
.ignoresSafeArea(edges: .top)
.onChange(of: manager.walletMetadata.discoveryState) {
_,
newValue in setSheetState(newValue)
newValue in setSheetState(newValue)
}
.onAppear { setSheetState(manager.walletMetadata.discoveryState) }
.onAppear(perform: manager.validateMetadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ struct TransactionsDetailScreen: View {
Group {
if let manager {
TransactionDetailsView(
id: id, transactionDetails: transactionDetails, manager: manager)
id: id, transactionDetails: transactionDetails, manager: manager
)
} else {
Text("Loading...")
}
Expand Down
3 changes: 2 additions & 1 deletion ios/Cove/Flows/SendFlow/SendRouteContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public struct SendRouteContainer: View {
switch sendRoute {
case let .setAmount(id: id, address: address, amount: amount):
SendFlowSetAmountScreen(
id: id, manager: manager, address: address?.string() ?? "", amount: amount)
id: id, manager: manager, address: address?.string() ?? "", amount: amount
)
case let .confirm(id: id, details: details):
SendFlowConfirmScreen(id: id, manager: manager, details: details)
case let .hardwareExport(id: id, details: details):
Expand Down
4 changes: 1 addition & 3 deletions rust/src/manager/pending_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ impl RustPendingWalletManager {
let (sender, receiver) = crossbeam::channel::bounded(1000);

Self {
state: Arc::new(RwLock::new(PendingWalletManagerState::new(
number_of_words,
))),
state: Arc::new(RwLock::new(PendingWalletManagerState::new(number_of_words))),
reconciler: sender,
reconcile_receiver: Arc::new(receiver),
}
Expand Down

0 comments on commit 419cd28

Please sign in to comment.