-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(mobile): split store into entity and model #15666
base: main
Are you sure you want to change the base?
Conversation
|
||
part 'user.entity.g.dart'; | ||
|
||
@Collection(inheritance: false, accessor: 'usr') |
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.
what is the accessor
and should we spell out the whole word as user
?
// Isar do not support nested transactions. This is a workaround to prevent us from making nested transactions | ||
// Reuse the current transaction if it is already active, else start a new transaction | ||
@override | ||
Future<T> nestTxn<T>(Future<T> Function() callback) => |
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.
Do we need nestTxn
? I haven't seen this mechanism used in the backend or current mobile codebase?
} | ||
|
||
static Store? _instance; | ||
static Store get I { |
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.
the Store.I.xxx
is singleton I assume? What is the notion of I
borrow from? is it from .NET world? :D
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.
The PR is not completed yet, correct? I tried to run it on the phone and still running into many errors
lib/pages/share_intent/share_intent.page.dart:22:37: Error: Undefined name 'StoreKey'.
db_store.Store.get(db_store.StoreKey.serverEndpoint);
^^^^^^^^
lib/pages/share_intent/share_intent.page.dart:22:18: Error: Undefined name 'Store'.
db_store.Store.get(db_store.StoreKey.serverEndpoint);
^^^^^
lib/repositories/album.repository.dart:50:38: Error: Member not found: 'Store.get'.
(q) => q.isarIdEqualTo(Store.get(StoreKey.currentUser).isarId),
^^^
lib/repositories/album.repository.dart:54:44: Error: Member not found: 'Store.get'.
(q) => q.not().isarIdEqualTo(Store.get(StoreKey.currentUser).isarId),
Changes made
TODO