More clean up
This commit is contained in:
parent
f4ef4eeea9
commit
5ad49c03a3
|
@ -344,7 +344,7 @@ class MatrixState extends State<Matrix> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
if (widget.client == null) {
|
if (widget.client == null) {
|
||||||
client = Client(widget.clientName, debug: true);
|
client = Client(widget.clientName, debug: false);
|
||||||
if (!kIsWeb) {
|
if (!kIsWeb) {
|
||||||
_initWithStore();
|
_initWithStore();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -14,7 +14,7 @@ extension LocalizedBody on Event {
|
||||||
getLocalizedBody(BuildContext context,
|
getLocalizedBody(BuildContext context,
|
||||||
{bool withSenderNamePrefix = false, hideQuotes = false}) {
|
{bool withSenderNamePrefix = false, hideQuotes = false}) {
|
||||||
if (this.redacted) {
|
if (this.redacted) {
|
||||||
return "Redacted by ${this.redactedBecause.sender.calcDisplayname()}";
|
return "Removed by ${this.redactedBecause.sender.calcDisplayname()}";
|
||||||
}
|
}
|
||||||
String localizedBody = body;
|
String localizedBody = body;
|
||||||
final String senderName = this.sender.calcDisplayname();
|
final String senderName = this.sender.calcDisplayname();
|
||||||
|
@ -214,8 +214,11 @@ extension LocalizedBody on Event {
|
||||||
|
|
||||||
// Hide quotes
|
// Hide quotes
|
||||||
if (hideQuotes) {
|
if (hideQuotes) {
|
||||||
|
print("+++ Hide quites +++");
|
||||||
List<String> lines = localizedBody.split("\n");
|
List<String> lines = localizedBody.split("\n");
|
||||||
|
print("Lines with quotes: ${lines.length}");
|
||||||
lines.removeWhere((s) => s.startsWith("> "));
|
lines.removeWhere((s) => s.startsWith("> "));
|
||||||
|
print("Lines without quotes: ${lines.length}");
|
||||||
localizedBody = lines.join("\n");
|
localizedBody = lines.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class _SettingsState extends State<Settings> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Client client = Matrix.of(context).client;
|
final Client client = Matrix.of(context).client;
|
||||||
profileFuture ??= client.getProfileFromUserId(client.userID);
|
profileFuture ??= client.ownProfile;
|
||||||
profileFuture.then((p) {
|
profileFuture.then((p) {
|
||||||
if (mounted) setState(() => profile = p);
|
if (mounted) setState(() => profile = p);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue