Adds logic for making folders
This commit is contained in:
parent
e71f55cbc4
commit
c1dd5e1957
6 changed files with 210 additions and 5 deletions
|
@ -13,6 +13,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
import 'package:zontreck/Constants.dart';
|
||||
import 'package:zontreck/Packets.dart';
|
||||
import 'package:zontreck/Settings.dart';
|
||||
import 'package:zontreck/pages/opensim/Inventory.dart';
|
||||
|
||||
class User {
|
||||
UUID ID;
|
||||
|
@ -51,7 +52,7 @@ class User {
|
|||
"rez": createdAt,
|
||||
"title": userTitle,
|
||||
"active": active,
|
||||
"token": loginToken
|
||||
"token": loginToken.toString()
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -115,9 +116,11 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
if (prefs.containsKey("settings")) {
|
||||
String encoded = prefs.getString("settings")!;
|
||||
CompoundTag tag = NbtIo.readBase64String(encoded) as CompoundTag;
|
||||
if (tag.contains("user"))
|
||||
CompoundTag tag = await NbtIo.readBase64String(encoded) as CompoundTag;
|
||||
if (tag.contains("user")) {
|
||||
settings.currentUser = User.load(tag.get("user") as CompoundTag);
|
||||
settings.loggedIn = true;
|
||||
}
|
||||
|
||||
// Validate current session
|
||||
var reply = await settings.sendPacketToEndpoint(
|
||||
|
@ -147,6 +150,14 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
setState(() {
|
||||
polling = false;
|
||||
});
|
||||
|
||||
if (settings.loggedIn && !settings.currentUser!.active) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (B) {
|
||||
return CreateInventoryPopup();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue