Skip to content

Commit c97a34a

Browse files
Apply suggestions from code review
Co-authored-by: Alex <[email protected]>
1 parent 9f8c308 commit c97a34a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mobile/lib/widgets/asset_viewer/description_input.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ class DescriptionInput extends HookConsumerWidget {
3434
final owner = ref.watch(currentUserProvider);
3535
final hasError = useState(false);
3636
final assetWithExif = ref.watch(assetDetailProvider(asset));
37-
final assetHasDescription = useState(false);
38-
final isAssetOwnedByUser = fastHash(owner?.id ?? '') == asset.ownerId;
37+
final hasDescription = useState(false);
38+
final isOwner = fastHash(owner?.id ?? '') == asset.ownerId;
3939

4040
useEffect(
4141
() {
4242
assetService.getDescription(asset).then((value) {
4343
controller.text = value;
44-
assetHasDescription.value = value.isNotEmpty;
44+
hasDescription.value = value.isNotEmpty;
4545
});
4646
return null;
4747
},
4848
[assetWithExif.value],
4949
);
5050

51-
if (!isAssetOwnedByUser && !assetHasDescription.value) {
51+
if (!isOwner && !hasDescription.value) {
5252
return const SizedBox.shrink();
5353
}
5454

@@ -89,7 +89,7 @@ class DescriptionInput extends HookConsumerWidget {
8989
}
9090

9191
return TextField(
92-
enabled: isAssetOwnedByUser,
92+
enabled: isOwner,
9393
focusNode: focusNode,
9494
onTap: () => isFocus.value = true,
9595
onChanged: (value) {

0 commit comments

Comments
 (0)