aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-30 00:19:39 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-30 00:19:39 +0800
commit5c66f9117fa0bf6a5be29243dbecbfe016b95345 (patch)
tree4d8cf02dcaa36e4f01fa4007a1403b593e39b654 /packages/instant/src
parent6222c952c3273ba91f20b5616793c534bb6dca28 (diff)
downloaddexon-0x-contracts-5c66f9117fa0bf6a5be29243dbecbfe016b95345.tar.gz
dexon-0x-contracts-5c66f9117fa0bf6a5be29243dbecbfe016b95345.tar.zst
dexon-0x-contracts-5c66f9117fa0bf6a5be29243dbecbfe016b95345.zip
assetAmount -> assetBuyAmount
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/util/analytics.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index 1468ef4a8..4b8aff4c9 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -206,10 +206,10 @@ export const analytics = {
...buyQuoteEventProperties(buyQuote),
fetchOrigin,
}),
- trackQuoteError: (errorMessage: string, assetAmount: BigNumber, fetchOrigin: QuoteFetchOrigin) => {
+ trackQuoteError: (errorMessage: string, assetBuyAmount: BigNumber, fetchOrigin: QuoteFetchOrigin) => {
trackingEventFnWithPayload(EventNames.QUOTE_ERROR)({
errorMessage,
- assetAmount: assetAmount.toString(),
+ assetBuyAmount: assetBuyAmount.toString(),
fetchOrigin,
});
},
60 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Code for checking for duplicates when doing EContact work.
 *
 * Authors:
 *   Christopher James Lahey <clahey@ximian.com>
 *   Chris Toshok <toshok@ximian.com>
 *
 * Copyright (C) 2001, 2002, 2003, Ximian, Inc.
 */

#include <config.h>

#include "eab-contact-merging.h"
#include "eab-contact-compare.h"
#include <glade/glade.h>
#include <gtk/gtksignal.h>
#include "addressbook/gui/widgets/eab-contact-display.h"

typedef enum {
    E_CONTACT_MERGING_ADD,
    E_CONTACT_MERGING_COMMIT
} EContactMergingOpType;

typedef struct {
    EContactMergingOpType op;
    EBook *book;
    EContact *contact;
    EBookIdCallback id_cb;
    EBookCallback   cb;
    gpointer closure;
} EContactMergingLookup;

static void
free_lookup (EContactMergingLookup *lookup)
{
    g_object_unref (lookup->book);
    g_object_unref (lookup->contact);

    g_free (lookup);
}

static void
final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
{
    EContactMergingLookup *lookup = closure;

    if (lookup->id_cb)
        lookup->id_cb (lookup->book, status, id, lookup->closure);

    free_lookup (lookup);
}

static void
final_cb (EBook *book, EBookStatus status, gpointer closure)
{
    EContactMergingLookup *lookup = closure;

    if (lookup->cb)
        lookup->cb (lookup->book, status, lookup->closure);

    free_lookup (lookup);
}

static void
doit (EContactMergingLookup *lookup)
{
    if (lookup->op == E_CONTACT_MERGING_ADD)
        e_book_async_add_contact (lookup->book, lookup->contact, final_id_cb, lookup);
    else if (lookup->op == E_CONTACT_MERGING_COMMIT)
        e_book_async_commit_contact (lookup->book, lookup->contact, final_cb, lookup);
}

static void
cancelit (EContactMergingLookup *lookup)
{
    if (lookup->op == E_CONTACT_MERGING_ADD) {
        if (lookup->id_cb)
            final_id_cb (lookup->book, E_BOOK_ERROR_CANCELLED, NULL, lookup);
    } else if (lookup->op == E_CONTACT_MERGING_COMMIT) {
        if (lookup->cb)
            final_cb (lookup->book, E_BOOK_ERROR_CANCELLED, lookup);
    }
}

static void
response (GtkWidget *dialog, int response, EContactMergingLookup *lookup)
{
    gtk_widget_destroy (dialog);

    switch (response) {
    case 0:
        doit (lookup);
        break;
    case 1:
        cancelit (lookup);
        break;
    }
}

static void
match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure)
{
    EContactMergingLookup *lookup = closure;

    if ((gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE) {
        doit (lookup);
    } else {
        GladeXML *ui;
        
        GtkWidget *widget;

        if (lookup->op == E_CONTACT_MERGING_ADD)
            ui = glade_xml_new (EVOLUTION_GLADEDIR "/eab-contact-duplicate-detected.glade", NULL, NULL);
        else if (lookup->op == E_CONTACT_MERGING_COMMIT)
            ui = glade_xml_new (EVOLUTION_GLADEDIR "/eab-contact-merging-commit-duplicate-detected.glade", NULL, NULL);
        else {
            doit (lookup);
            return;
        }

        widget = glade_xml_get_widget (ui, "custom-old-contact");
        eab_contact_display_render (EAB_CONTACT_DISPLAY (widget),
                        match, EAB_CONTACT_DISPLAY_RENDER_COMPACT);

        widget = glade_xml_get_widget (ui, "custom-new-contact");
        eab_contact_display_render (EAB_CONTACT_DISPLAY (widget),
                        contact, EAB_CONTACT_DISPLAY_RENDER_COMPACT);

        widget = glade_xml_get_widget (ui, "dialog-duplicate-contact");

        g_signal_connect (widget, "response",
                  G_CALLBACK (response), lookup);

        gtk_widget_show_all (widget);
    }
}

gboolean
eab_merging_book_add_contact (EBook           *book,
                  EContact           *contact,
                  EBookIdCallback  cb,
                  gpointer         closure)
{
    EContactMergingLookup *lookup;

    lookup = g_new (EContactMergingLookup, 1);

    lookup->op = E_CONTACT_MERGING_ADD;
    lookup->book = g_object_ref (book);
    lookup->contact = g_object_ref (contact);
    lookup->id_cb = cb;
    lookup->closure = closure;

    eab_contact_locate_match_full (book, contact, NULL, match_query_callback, lookup);

    return TRUE;
}

gboolean
eab_merging_book_commit_contact (EBook                 *book,
                 EContact                 *contact,
                 EBookCallback          cb,
                 gpointer               closure)
{
    EContactMergingLookup *lookup;
    GList *avoid;
    
    lookup = g_new (EContactMergingLookup, 1);

    lookup->op = E_CONTACT_MERGING_COMMIT;
    lookup->book = g_object_ref (book);
    lookup->contact = g_object_ref (contact);
    lookup->cb = cb;
    lookup->closure = closure;

    avoid = g_list_append (NULL, contact);

    eab_contact_locate_match_full (book, contact, avoid, match_query_callback, lookup);

    g_list_free (avoid);

    return TRUE;
}

GtkWidget *
_eab_contact_merging_create_contact_display(gchar *name,
                        gchar *string1, gchar *string2,
                        gint int1, gint int2);

GtkWidget *
_eab_contact_merging_create_contact_display(gchar *name,
                        gchar *string1, gchar *string2,
                        gint int1, gint int2)
{
    return eab_contact_display_new();
}