Skip to content

Commit

Permalink
fix: Fixed onInitialize being called twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Feb 7, 2023
1 parent 30b0fee commit eb671ff
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 36 deletions.
15 changes: 7 additions & 8 deletions packages/katana_model/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,17 @@ packages:
source: hosted
version: "4.8.0"
katana:
dependency: transitive
dependency: "direct overridden"
description:
name: katana
sha256: "9a3ec047c35ec88e027139e88ce45202b022dd2111b38848c85159101b0028ce"
url: "https://pub.dev"
source: hosted
path: "../../katana"
relative: true
source: path
version: "1.0.5"
katana_listenables_annotation:
dependency: "direct overridden"
description:
path: "../../katana_listenables_annotation"
relative: true
path: "/Users/mathru/Documents/github/flutter_masamune/packages/katana_model/example/../../katana_listenables_annotation"
relative: false
source: path
version: "1.2.14"
katana_model:
Expand All @@ -357,7 +356,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.5.10"
version: "1.5.11"
lints:
dependency: transitive
description:
Expand Down
9 changes: 4 additions & 5 deletions packages/katana_model/lib/src/no_sql_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ class NoSqlDatabase {
this.onLoad,
this.onSaved,
this.onDeleted,
}) {
onInitialize?.call(this);
}
});

/// Location where real data is stored.
///
Expand Down Expand Up @@ -137,13 +135,13 @@ class NoSqlDatabase {
try {
_initialized = true;
await onInitialize?.call(this);
_completer?.complete(e);
_completer?.complete();
_completer = null;
} catch (e) {
_completer?.completeError(e);
_completer = null;
} finally {
_completer?.complete(e);
_completer?.complete();
_completer = null;
}
}
Expand Down Expand Up @@ -389,6 +387,7 @@ class NoSqlDatabase {
value
.toList(
(key, value) {
// ignore: unnecessary_type_check
if (value is! Map) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DatabaseExporter {
///
/// [fileName]に保存されているデータをインポートします。
///
/// Webの場合は[fileName]をキーにした状態でLocalStorage`から取得します。
/// Webの場合は[fileName]をキーにした状態で`LocalStorage`から取得します。
///
/// [fileName]に基づく復号化を行ないます。エクスポート時と[fileName]が異なる場合インポートできません。
static Future<DynamicMap> import(String fileName) async {
Expand Down
2 changes: 1 addition & 1 deletion packages/katana_model/lib/src/web/database_exporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DatabaseExporter {
///
/// [fileName]に保存されているデータをインポートします。
///
/// Webの場合は[fileName]をキーにした状態でLocalStorage`から取得します。
/// Webの場合は[fileName]をキーにした状態で`LocalStorage`から取得します。
///
/// [fileName]に基づく復号化を行ないます。エクスポート時と[fileName]が異なる場合インポートできません。
static Future<DynamicMap> import(String fileName) async {
Expand Down
11 changes: 5 additions & 6 deletions packages/katana_model/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "961c4aebd27917269b1896382c7cb1b1ba81629ba669ba09c27a7e5710ec9040"
sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
url: "https://pub.dev"
source: hosted
version: "1.6.2"
version: "1.6.3"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -350,10 +350,9 @@ packages:
katana:
dependency: "direct main"
description:
name: katana
sha256: "9a3ec047c35ec88e027139e88ce45202b022dd2111b38848c85159101b0028ce"
url: "https://pub.dev"
source: hosted
path: "../katana"
relative: true
source: path
version: "1.0.5"
lints:
dependency: transitive
Expand Down
27 changes: 12 additions & 15 deletions packages/katana_model_firestore/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "961c4aebd27917269b1896382c7cb1b1ba81629ba669ba09c27a7e5710ec9040"
sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
url: "https://pub.dev"
source: hosted
version: "1.6.2"
version: "1.6.3"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -283,27 +283,24 @@ packages:
katana:
dependency: "direct main"
description:
name: katana
sha256: "9a3ec047c35ec88e027139e88ce45202b022dd2111b38848c85159101b0028ce"
url: "https://pub.dev"
source: hosted
path: "../katana"
relative: true
source: path
version: "1.0.5"
katana_firebase:
dependency: "direct main"
description:
name: katana_firebase
sha256: "8294c984f0c13d5dd2950694279242e7b8b167493ecd0f0f7a82bf3384da2b4d"
url: "https://pub.dev"
source: hosted
path: "../katana_firebase"
relative: true
source: path
version: "1.1.12"
katana_model:
dependency: "direct main"
description:
name: katana_model
sha256: "10fa4f40f70d9e3dbadc3fd57987087ce175ee6cfd5e22c9dfc95e0fa3393cdb"
url: "https://pub.dev"
source: hosted
version: "1.5.10"
path: "../katana_model"
relative: true
source: path
version: "1.5.11"
lints:
dependency: transitive
description:
Expand Down

0 comments on commit eb671ff

Please sign in to comment.