Re add chatwoot (#1044)

* Revert "Revert "Cw 397 chatwoot live support (#1011)""

This reverts commit ecdc7baa2e3c8f46c3c5013f56c8b864f088ec9f.

* Re-add chatwoot
Change chatwoot base url
This commit is contained in:
Omar Hatem
2023-08-15 03:47:25 +03:00
committed by GitHub
parent ad6edd9a05
commit 5ec930cbc6
63 changed files with 762 additions and 260 deletions
+14 -15
View File
@@ -1,12 +1,9 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/settings/link_list_item.dart';
import 'package:cake_wallet/view_model/settings/regular_list_item.dart';
import 'package:cake_wallet/view_model/settings/settings_list_item.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
part 'support_view_model.g.dart';
@@ -15,14 +12,6 @@ class SupportViewModel = SupportViewModelBase with _$SupportViewModel;
abstract class SupportViewModelBase with Store {
SupportViewModelBase()
: items = [
RegularListItem(
title: S.current.faq,
handler: (BuildContext context) async {
try {
await launch(url);
} catch (e) {}
},
),
LinkListItem(
title: 'Email',
linkTitle: 'support@cakewallet.com',
@@ -85,7 +74,17 @@ abstract class SupportViewModelBase with Store {
// link: 'mailto:support@y.at')
];
static const url = 'https://guides.cakewallet.com';
final guidesUrl = 'https://guides.cakewallet.com';
String fetchUrl({String locale = "en", String authToken = ""}) {
var supportUrl =
"https://app.chatwoot.com/widget?website_token=${secrets.chatwootWebsiteToken}&locale=${locale}";
if (authToken.isNotEmpty)
supportUrl += "&cw_conversation=$authToken";
return supportUrl;
}
List<SettingsListItem> items;
}
}