⬆️ Upgrade to support latest version of server
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/providers/account.dart';
|
||||
import 'package:solian/providers/websocket.dart';
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/models/notification.dart' as notify;
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
@ -23,7 +23,7 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
||||
|
||||
setState(() => _isBusy = true);
|
||||
|
||||
final AccountProvider provider = Get.find();
|
||||
final WebSocketProvider provider = Get.find();
|
||||
|
||||
List<int> markList = List.empty(growable: true);
|
||||
for (final element in provider.notifications) {
|
||||
@ -32,8 +32,8 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
||||
}
|
||||
|
||||
if (markList.isNotEmpty) {
|
||||
final client = auth.configureClient('passport');
|
||||
await client.put('/api/notifications/batch/read', {'messages': markList});
|
||||
final client = auth.configureClient('auth');
|
||||
await client.put('/notifications/batch/read', {'messages': markList});
|
||||
}
|
||||
|
||||
provider.notifications.clear();
|
||||
@ -45,7 +45,7 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
||||
final AuthProvider auth = Get.find();
|
||||
if (!await auth.isAuthorized) return;
|
||||
|
||||
final AccountProvider provider = Get.find();
|
||||
final WebSocketProvider provider = Get.find();
|
||||
|
||||
if (element.id <= 0) {
|
||||
provider.notifications.removeAt(index);
|
||||
@ -54,9 +54,9 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
||||
|
||||
setState(() => _isBusy = true);
|
||||
|
||||
final client = auth.configureClient('passport');
|
||||
final client = auth.configureClient('auth');
|
||||
|
||||
await client.put('/api/notifications/${element.id}/read', {});
|
||||
await client.put('/notifications/${element.id}/read', {});
|
||||
|
||||
provider.notifications.removeAt(index);
|
||||
|
||||
@ -65,7 +65,7 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final AccountProvider provider = Get.find();
|
||||
final WebSocketProvider provider = Get.find();
|
||||
|
||||
return SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.85,
|
||||
@ -175,7 +175,7 @@ class NotificationButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final AccountProvider provider = Get.find();
|
||||
final WebSocketProvider provider = Get.find();
|
||||
|
||||
final button = IconButton(
|
||||
icon: const Icon(Icons.notifications),
|
||||
|
@ -100,10 +100,10 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
||||
return;
|
||||
}
|
||||
|
||||
final client = auth.configureClient('passport');
|
||||
final client = auth.configureClient('auth');
|
||||
|
||||
final resp = await client.put(
|
||||
'/api/users/me/$position',
|
||||
'/users/me/$position',
|
||||
{'attachment': attachResp.body['id']},
|
||||
);
|
||||
if (resp.statusCode == 200) {
|
||||
@ -122,11 +122,11 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
||||
|
||||
setState(() => _isBusy = true);
|
||||
|
||||
final client = auth.configureClient('passport');
|
||||
final client = auth.configureClient('auth');
|
||||
|
||||
_birthday?.toIso8601String();
|
||||
final resp = await client.put(
|
||||
'/api/users/me',
|
||||
'/users/me',
|
||||
{
|
||||
'nick': _nicknameController.value.text,
|
||||
'description': _descriptionController.value.text,
|
||||
@ -189,7 +189,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
child: _banner != null
|
||||
? Image.network(
|
||||
'${ServiceFinder.services['paperclip']}/api/attachments/$_banner',
|
||||
ServiceFinder.buildUrl('files', '/attachments/$_banner'),
|
||||
fit: BoxFit.cover,
|
||||
loadingBuilder: (BuildContext context, Widget child,
|
||||
ImageChunkEvent? loadingProgress) {
|
||||
|
Reference in New Issue
Block a user