Skip to content
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

fix: display invalid status in UI #683

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DashSyncCurrentCommit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d92d814f3f9a3d40126a9359b578831d8eb97293
81cec5027e93a83038607bd404ad7bb2d63cbd51
32 changes: 16 additions & 16 deletions DashWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10285,7 +10285,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -10425,7 +10425,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -10599,7 +10599,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -10621,7 +10621,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -10646,7 +10646,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand All @@ -10673,7 +10673,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down Expand Up @@ -10705,7 +10705,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.2.3;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -10734,7 +10734,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.2.3;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -11413,7 +11413,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -11526,7 +11526,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.2.3;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -11582,7 +11582,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -11607,7 +11607,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down Expand Up @@ -11724,7 +11724,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -11836,7 +11836,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.2.3;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -11891,7 +11891,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -11916,7 +11916,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 8.3.0;
MARKETING_VERSION = 8.3.1;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "error.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "error@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "error@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 5 additions & 12 deletions DashWallet/Sources/Models/Transactions/Model/Transaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Transaction: TransactionDataItem, Identifiable {
}

var iconName: String {
direction.iconName
state == .invalid ? "tx.invalid.icon" : direction.iconName
}

private lazy var storedFiatAmount = userInfo?.fiatAmountString(from: _dashAmount) ?? NSLocalizedString("Not available", comment: "");
Expand Down Expand Up @@ -109,7 +109,7 @@ class Transaction: TransactionDataItem, Identifiable {

if (direction == .sent || direction == .moved)
&& confirms == 0
&& !isValid(account, tx) {
&& !account!.transactionIsValid(tx) {
return .invalid
} else if direction == .received {
if !instantSendReceived && confirms == 0 && isPending(account, tx) {
Expand Down Expand Up @@ -154,14 +154,6 @@ class Transaction: TransactionDataItem, Identifiable {

return account!.transactionIsVerified(tx)
}

private func isValid(_ account: DSAccount?, _ tx: DSTransaction) -> Bool {
if tx.timestamp + kConfirmationThreshold < Date().timeIntervalSince1970 {
return true
}

return account!.transactionIsValid(tx)
}

private lazy var _shortDateString: String = tx.formattedShortTxDate
var date: Date
Expand All @@ -181,8 +173,9 @@ class Transaction: TransactionDataItem, Identifiable {
case .sent:
if state == .processing {
return NSLocalizedString("Sending", comment: "")
}
else {
} else if state == .invalid {
return NSLocalizedString("Invalid", comment: "")
} else {
return NSLocalizedString("Sent", comment: "")
}
case .received, .notAccountFunds:
Expand Down
2 changes: 1 addition & 1 deletion DashWallet/Sources/UI/Home/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ struct HomeViewContent<Content: View>: View {
TransactionPreview(
title: txItem.stateTitle,
subtitle: txItem.shortTimeString,
icon: .custom(txItem.direction.iconName),
icon: .custom(txItem.iconName),
dashAmount: txItem.signedDashAmount,
overrideFiatAmount: txItem.fiatAmount
) {
Expand Down