Create, edit, list publishers

This commit is contained in:
2024-11-09 21:47:40 +08:00
parent a629f5e12c
commit ed2e44cc54
13 changed files with 584 additions and 18 deletions

View File

@ -28,11 +28,10 @@ class UserProvider extends ChangeNotifier {
}
Future<SnAccount?> refreshUser() async {
if (!isAuthorized) return null;
final resp = await _sn.client.get('/cgi/id/users/me');
final out = SnAccount.fromJson(resp.data);
isAuthorized = true;
user = out;
notifyListeners();
@ -40,7 +39,7 @@ class UserProvider extends ChangeNotifier {
}
void logoutUser() async {
_sn.clearTokenPair();
await _sn.clearTokenPair();
isAuthorized = false;
user = null;
notifyListeners();