-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,10 @@ class HiveImpl extends TypeRegistryImpl implements HiveInterface { | |
|
||
@override | ||
void init(String path) { | ||
if (homePath != null) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
themisir
Contributor
|
||
throw HiveError('Instance has already been initialized.'); | ||
} | ||
homePath = path; | ||
|
||
_boxes.clear(); | ||
} | ||
|
||
Future<BoxBase<E>> _openBox<E>( | ||
|
1 comment
on commit 59ad540
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the remark by felangel, this is also removing idempotency from this API call. Ideally it should just silently do nothing and report success.
@leisim why was this change made? Previously it was possible to have multiple instances as described in #336 (comment). This change makes that use case no longer possible.