mirror of
				https://github.com/MaidFoundation/maid.git
				synced 2023-12-01 22:17:36 +03:00 
			
		
		
		
	Fix local gen
This commit is contained in:
		| @@ -23,7 +23,12 @@ class Character extends ChangeNotifier { | ||||
|   Character() { | ||||
|     _initProfile().then((value) => resetAll()); | ||||
|     SharedPreferences.getInstance().then((prefs) { | ||||
|       fromMap(json.decode(prefs.getString("last_character") ?? "{}")); | ||||
|       Map<String, dynamic> lastCharacter = json.decode(prefs.getString("last_character") ?? "{}"); | ||||
|       if (lastCharacter.isNotEmpty) { | ||||
|         fromMap(lastCharacter); | ||||
|       } else { | ||||
|         resetAll(); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -16,7 +16,12 @@ class Model extends ChangeNotifier { | ||||
|  | ||||
|   Model() { | ||||
|     SharedPreferences.getInstance().then((prefs) { | ||||
|       fromMap(json.decode(prefs.getString("last_model") ?? "{}")); | ||||
|       Map<String, dynamic> lastModel= json.decode(prefs.getString("last_model") ?? "{}"); | ||||
|       if (lastModel.isNotEmpty) { | ||||
|         fromMap(lastModel); | ||||
|       } else { | ||||
|         resetAll(); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 dane madsen
					dane madsen