mirror of https://github.com/NekoX-Dev/NekoX.git
Fix SharedConfig
This commit is contained in:
parent
b30bc1ed80
commit
9c10d75bdf
|
@ -42,6 +42,7 @@ import java.util.Iterator;
|
|||
import java.util.LinkedList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import okhttp3.HttpUrl;
|
||||
import tw.nekomimi.nekogram.ProxyManager;
|
||||
|
@ -142,10 +143,13 @@ public class SharedConfig {
|
|||
|
||||
public static int distanceSystemType;
|
||||
|
||||
public static HashSet<Integer> activeAccounts;
|
||||
|
||||
public static ConcurrentHashSet<Integer> activeAccounts;
|
||||
public static int loginingAccount = -1;
|
||||
|
||||
static {
|
||||
loadConfig();
|
||||
}
|
||||
|
||||
public static class ProxyInfo implements Comparable<ProxyInfo> {
|
||||
|
||||
public int group;
|
||||
|
@ -1040,7 +1044,7 @@ public class SharedConfig {
|
|||
disableVoiceAudioEffects = preferences.getBoolean("disableVoiceAudioEffects", false);
|
||||
preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
||||
showNotificationsForAllAccounts = preferences.getBoolean("AllAccounts", true);
|
||||
activeAccounts = Arrays.stream(preferences.getString("active_accounts", "").split(",")).filter(StrUtil::isNotBlank).map(Integer::parseInt).collect(Collectors.toCollection(HashSet::new));
|
||||
activeAccounts = Arrays.stream(preferences.getString("active_accounts", "").split(",")).filter(StrUtil::isNotBlank).map(Integer::parseInt).collect(Collectors.toCollection(ConcurrentHashSet::new));
|
||||
|
||||
if (!preferences.contains("accounts_loaded")) {
|
||||
int maxAccounts;
|
||||
|
|
Loading…
Reference in New Issue