Exemplo n.º 1
0
        private async Task FetchInstances()
        {
            IsLoading.Value = true;
            Instances.Clear();
            var res = await Http.GetAsync("https://join.misskey.page/instances.json");

            var json = JsonConvert.DeserializeObject <JoinMisskeyInstances>(await res.Content.ReadAsStringAsync());

            Instances.AddRangeOnScheduler(
                json.Instances
                .Where(i => i.Meta != null)
                .Where(i => !i.Meta.DisableRegistration)
                .OrderByDescending(i => i.Value)
                .OrderByDescending(i => i.Meta.IsGroundpolis ? 1 : 0)
                .Select(i => new JoinMisskeyInstanceViewModel(i))
                );

            IsLoading.Value = false;
        }