diff --git a/src/models/explore.ts b/src/models/explore.ts index 9ad73fe4..83c34abe 100644 --- a/src/models/explore.ts +++ b/src/models/explore.ts @@ -212,6 +212,22 @@ export class TransactionExploreQuery { return finalTokens; } + public clone(): TransactionExploreQuery { + const clonedConditions: TransactionExploreConditionWithRelation[] = []; + + for (const condition of this.conditions) { + const clonedCondition = TransactionExploreConditionWithRelation.parse(condition.toJsonObject()); + + if (!clonedCondition) { + continue; + } + + clonedConditions.push(clonedCondition); + } + + return new TransactionExploreQuery(this.name, clonedConditions); + } + public toJson(): string { return JSON.stringify({ name: this.name, diff --git a/src/views/desktop/insights/tabs/ExploreQueryTab.vue b/src/views/desktop/insights/tabs/ExploreQueryTab.vue index f4cfa6bf..6775b584 100644 --- a/src/views/desktop/insights/tabs/ExploreQueryTab.vue +++ b/src/views/desktop/insights/tabs/ExploreQueryTab.vue @@ -1,31 +1,66 @@