Skip to content
Snippets Groups Projects
Commit 380b51de authored by poka's avatar poka
Browse files

feat: add real date of certifications

parent c7b4f396
Branches
Tags
No related merge requests found
Pipeline #36878 failed
...@@ -68,11 +68,16 @@ const String getCertsReceived = r''' ...@@ -68,11 +68,16 @@ const String getCertsReceived = r'''
query ($address: String!) { query ($address: String!) {
certConnection( certConnection(
where: {receiver: {accountId: {_eq: $address}}} where: {receiver: {accountId: {_eq: $address}}}
orderBy: {updatedOn: DESC}
) { ) {
edges { edges {
node { node {
isActive isActive
createdOn updatedIn {
block {
timestamp
}
}
issuer { issuer {
accountId accountId
name name
...@@ -87,11 +92,16 @@ const String getCertsSent = r''' ...@@ -87,11 +92,16 @@ const String getCertsSent = r'''
query ($address: String!) { query ($address: String!) {
certConnection( certConnection(
where: {issuer: {accountId: {_eq: $address}}} where: {issuer: {accountId: {_eq: $address}}}
orderBy: {updatedOn: DESC}
) { ) {
edges { edges {
node { node {
isActive isActive
createdOn updatedIn {
block {
timestamp
}
}
receiver { receiver {
accountId accountId
name name
......
...@@ -18,6 +18,10 @@ class CertsList extends StatelessWidget { ...@@ -18,6 +18,10 @@ class CertsList extends StatelessWidget {
final String address; final String address;
final CertDirection direction; final CertDirection direction;
String formatNumber(int number) {
return number < 10 ? '0$number' : '$number';
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final indexerProvider = Provider.of<DuniterIndexer>(context, listen: false); final indexerProvider = Provider.of<DuniterIndexer>(context, listen: false);
...@@ -81,9 +85,12 @@ class CertsList extends StatelessWidget { ...@@ -81,9 +85,12 @@ class CertsList extends StatelessWidget {
} }
final String issuerAddress = cert[certFrom]['accountId']; final String issuerAddress = cert[certFrom]['accountId'];
final String issuerName = cert[certFrom]['name']; final String issuerName = cert[certFrom]['name'];
final date = DateTime.parse('2024-02-04T21:20:54.001+00:00'); final date =
DateTime.parse(cert['updatedIn']['block']['timestamp']);
final dp = DateTime(date.year, date.month, date.day); final dp = DateTime(date.year, date.month, date.day);
final dateForm = '${dp.day}-${dp.month}-${dp.year}';
final dateForm =
'${formatNumber(dp.day)}-${formatNumber(dp.month)}-${dp.year}';
// Check if we have a more recent certification, we skip // Check if we have a more recent certification, we skip
if (!listCerts.any((cert) => cert['address'] == issuerAddress)) { if (!listCerts.any((cert) => cert['address'] == issuerAddress)) {
......
...@@ -2,7 +2,7 @@ name: gecko ...@@ -2,7 +2,7 @@ name: gecko
description: Pay with G1. description: Pay with G1.
publish_to: "none" publish_to: "none"
version: 0.1.7+77 version: 0.1.7+78
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment