Fixes
This commit is contained in:
13
lib/db.dart
13
lib/db.dart
@@ -64,28 +64,33 @@ class SqliteHelper {
|
||||
}
|
||||
|
||||
/// Создается запись в таблице, содержащая данные, которые не зависят от сессии.
|
||||
Future createAppInfo(int currency) async {
|
||||
Future createAppInfo(int currency, String locale) async {
|
||||
List<Map> appInfo = await db.query(tableSettings);
|
||||
if (appInfo.length > 0) {
|
||||
return null;
|
||||
} else {
|
||||
return db.insert(tableSettings, {
|
||||
columnCurrency: currency
|
||||
columnCurrency: currency,
|
||||
columnLocale: locale
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map> getSettings(bool withSession) async {
|
||||
|
||||
Map results = new Map();
|
||||
Map settings = await selectAll(tableSettings);
|
||||
|
||||
results.addAll(settings);
|
||||
|
||||
if (withSession) {
|
||||
Map session = await selectAll(tableSession);
|
||||
if (settings != null && session != null) {
|
||||
settings.addAll(session);
|
||||
results.addAll(session);
|
||||
}
|
||||
}
|
||||
|
||||
return settings;
|
||||
return results;
|
||||
}
|
||||
|
||||
Future<String> getToken() async {
|
||||
|
||||
Reference in New Issue
Block a user