Skip to content

Commit a4f3c4a

Browse files
committed
Fixed links.
Fixed AccountsProvider threading
1 parent decf2ea commit a4f3c4a

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Adamant/Assets/l18n/de.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@
754754
"WelcomeScene.Description.Slide1" = "Willkommen in ADAMANT, einem echten Messenger auf der <b>Blockchain</b>.";
755755

756756
/* Welcome: Slide 2 Description */
757-
"WelcomeScene.Description.Slide2" = "ADAMANT ist <b>Anonymität</b> und <b>Sicherheit</b> Ihrer Kommunikation sowie Versand von Kryptowährungen in Chats.<br/><br/><a href=\https://medium.com/adamant-im/adamant-security-features-e7cc836ff52c\>Warum sind alle anderen Messenger nicht sicher?</a>";
757+
"WelcomeScene.Description.Slide2" = "ADAMANT ist <b>Anonymität</b> und <b>Sicherheit</b> Ihrer Kommunikation sowie Versand von Kryptowährungen in Chats.<br/><br/><a href=\"https://medium.com/adamant-im/adamant-security-features-e7cc836ff52c\">Warum sind alle anderen Messenger nicht sicher?</a>";
758758

759759
/* Welcome: Slide 3 Description */
760760
"WelcomeScene.Description.Slide3" = "Die Infrastruktur von ADAMANT hat keinen Besitzer, sie ist <b>dezentralisiert</b>.<br/><br/>Für ihre Unterstützung alle Nachrichten im Messenger werden mit ADM-Tokens bezahlt. Neue Konten erhalten kostenlose Tokens als Geschenk";
@@ -763,7 +763,7 @@
763763
"WelcomeScene.Description.Slide4" = "Um eine Konversation zu starten, erstellen Sie einfach ein neues Konto mit einem Klick <b>(Sie müssen keine Daten eingeben)</b> und fügen Sie Ihren ersten Gesprächspartner hinzu.<br/><br/>Wenn Sie Ihre Anonymität schätzen, empfehlen wir Ihnen, ADAMANT-Adressen <b>persönlich</b> mitzuteilen.";
764764

765765
/* Welcome: Slide 5 Description */
766-
"WelcomeScene.Description.Slide5" = "Der Quellcode des Projekts ist <a href=\https://github.com/Adamant-im/\>zu 100% offen</a>. Die App wird entwickelt und neue Funktionen werden ständig hinzugefügt.<br/><br/>Wenn Sie Entwickler sind, sind Sie bei uns herzlich willkommen.";
766+
"WelcomeScene.Description.Slide5" = "Der Quellcode des Projekts ist <a href=\"https://github.com/Adamant-im/\">zu 100% offen</a>. Die App wird entwickelt und neue Funktionen werden ständig hinzugefügt.<br/><br/>Wenn Sie Entwickler sind, sind Sie bei uns herzlich willkommen.";
767767

768768
/* WelcomeScene.Description.BeginButton */
769769
"WelcomeScene.Description.BeginButton" = "Sichere Kommunikation starten";

Adamant/Assets/l18n/en.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@
806806
"WelcomeScene.Description.Slide1" = "Welcome to ADAMANT, the genuine <b>blockchain</b> messenger.";
807807

808808
/* Welcome: Slide 2 Description */
809-
"WelcomeScene.Description.Slide2" = "ADAMANT is <b>anonymity</b> and <b>security</b> of your messaging as well as in-chat cryptocurrency transferring tool.<br/><br/><a href=\https://medium.com/adamant-im/adamant-security-features-e7cc836ff52c\>Why are other messengers not secure?</a>";
809+
"WelcomeScene.Description.Slide2" = "ADAMANT is <b>anonymity</b> and <b>security</b> of your messaging as well as in-chat cryptocurrency transferring tool.<br/><br/><a href=\"https://medium.com/adamant-im/adamant-security-features-e7cc836ff52c\">Why are other messengers not secure?</a>";
810810

811811
/* Welcome: Slide 3 Description */
812812
"WelcomeScene.Description.Slide3" = "ADAMANT infrastracture doesn't belong to anyone and is <b>decentralized</b>.<br/><br/>It is maintained by messages paid in ADM tokens. New accounts may receive free tokens for testing purposes.";
@@ -815,7 +815,7 @@
815815
"WelcomeScene.Description.Slide4" = "Create an account in a single click <b>without any requirements</b> (no email/phone/anything) and invite your friends.<br/><br/>Share your ADAMANT addresses <b>in-person</b> for true security.";
816816

817817
/* Welcome: Slide 5 Description */
818-
"WelcomeScene.Description.Slide5" = "The project's source code is <a href=\https://github.com/Adamant-im/\>completely open</a>. The app is in development and we constantly add new features.<br/><br/>If you are a developer — join our team.";
818+
"WelcomeScene.Description.Slide5" = "The project's source code is <a href=\"https://github.com/Adamant-im/\">completely open</a>. The app is in development and we constantly add new features.<br/><br/>If you are a developer — join our team.";
819819

820820
/* WelcomeScene.Description.BeginButton */
821821
"WelcomeScene.Description.BeginButton" = "Start secure messaging";

Adamant/Services/DataProviders/AdamantAccountsProvider.swift

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,23 @@ class AdamantAccountsProvider: AccountsProvider {
138138
request.fetchLimit = 1
139139
request.predicate = predicate
140140

141-
var acc = (try? (context ?? stack.container.viewContext).fetch(request))?.first
141+
var acc: BaseAccount? = nil
142142

143143
if let context = context {
144-
acc = (try? context.fetch(request))?.first
144+
// viewContext only on MainThread
145+
if context == stack.container.viewContext {
146+
if Thread.isMainThread {
147+
acc = (try? context.fetch(request))?.first
148+
} else {
149+
DispatchQueue.main.sync {
150+
acc = (try? context.fetch(request))?.first
151+
}
152+
}
153+
} else {
154+
acc = (try? context.fetch(request))?.first
155+
}
145156
} else {
157+
// viewContext only on MainThread
146158
if Thread.isMainThread {
147159
acc = (try? stack.container.viewContext.fetch(request))?.first
148160
} else {
@@ -151,14 +163,6 @@ class AdamantAccountsProvider: AccountsProvider {
151163
}
152164
}
153165
}
154-
155-
if Thread.isMainThread {
156-
acc = (try? (context ?? stack.container.viewContext).fetch(request))?.first
157-
} else {
158-
DispatchQueue.main.sync {
159-
acc = (try? (context ?? stack.container.viewContext).fetch(request))?.first
160-
}
161-
}
162166

163167
switch acc {
164168
case let core as CoreDataAccount:

0 commit comments

Comments
 (0)