mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 02:12:00 +01:00
Remove AtomicBoolean
This commit is contained in:
parent
bddeb381a6
commit
4b88465b47
@ -40,7 +40,6 @@ import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@ -60,7 +59,7 @@ public final class User implements PersistedDataHost {
|
||||
private ObjectProperty<PaymentAccount> currentPaymentAccountProperty;
|
||||
|
||||
private UserPayload userPayload = new UserPayload();
|
||||
private AtomicBoolean initialReadDone = new AtomicBoolean(false);
|
||||
private boolean initialReadDone = false;
|
||||
|
||||
@Inject
|
||||
public User(Storage<UserPayload> storage, KeyRing keyRing) throws NoSuchAlgorithmException {
|
||||
@ -102,13 +101,13 @@ public final class User implements PersistedDataHost {
|
||||
persist();
|
||||
});
|
||||
|
||||
initialReadDone.set(true);
|
||||
initialReadDone = true;
|
||||
}
|
||||
|
||||
private void persist() {
|
||||
// TODO if we persist we get a blank screen (exception in view class contrs. or circ. dependency?)
|
||||
if (initialReadDone.get())
|
||||
storage.queueUpForSave(userPayload);
|
||||
if (initialReadDone)
|
||||
storage.queueUpForSave(userPayload);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user