mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: fav: validate ownership
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -339,20 +339,22 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
loadingState.response[index].id,
|
loadingState.response[index].id,
|
||||||
loadingState.response[index].type,
|
loadingState.response[index].type,
|
||||||
),
|
),
|
||||||
onTap:
|
onTap: _favDetailController.enableMultiSelect.value
|
||||||
_favDetailController.enableMultiSelect.value.not
|
? () {
|
||||||
? null
|
|
||||||
: () {
|
|
||||||
_favDetailController.onSelect(index);
|
|
||||||
},
|
|
||||||
onLongPress: () {
|
|
||||||
if (_favDetailController
|
|
||||||
.enableMultiSelect.value.not) {
|
|
||||||
_favDetailController.enableMultiSelect.value =
|
|
||||||
true;
|
|
||||||
_favDetailController.onSelect(index);
|
_favDetailController.onSelect(index);
|
||||||
}
|
}
|
||||||
},
|
: null,
|
||||||
|
onLongPress: _favDetailController.isOwner.value
|
||||||
|
? () {
|
||||||
|
if (_favDetailController
|
||||||
|
.enableMultiSelect.value.not) {
|
||||||
|
_favDetailController
|
||||||
|
.enableMultiSelect.value = true;
|
||||||
|
_favDetailController.onSelect(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
isOwner: _favDetailController.isOwner.value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
final int? searchType;
|
final int? searchType;
|
||||||
final GestureTapCallback? onTap;
|
final GestureTapCallback? onTap;
|
||||||
final GestureLongPressCallback? onLongPress;
|
final GestureLongPressCallback? onLongPress;
|
||||||
|
final bool isOwner;
|
||||||
|
|
||||||
const FavVideoCardH({
|
const FavVideoCardH({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -28,6 +29,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
this.searchType,
|
this.searchType,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
|
this.isOwner = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -211,8 +213,8 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
searchType != 1
|
if (searchType != 1 && isOwner)
|
||||||
? Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: -4,
|
bottom: -4,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
@@ -233,9 +235,8 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'取消',
|
'取消',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context)
|
color:
|
||||||
.colorScheme
|
Theme.of(context).colorScheme.outline),
|
||||||
.outline),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -256,8 +257,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
size: 18,
|
size: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
: const SizedBox(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user