fix filter dyn

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-04 17:35:55 +08:00
parent 708bf27710
commit 9ce84fb997
3 changed files with 29 additions and 27 deletions

View File

@@ -917,7 +917,7 @@ class RichTextEditingController extends TextEditingController {
}
if (offset > range.start && offset < range.end) {
if (e.isRich) {
if (offset < value.selection.baseOffset) {
if (offset < selection.baseOffset) {
return newSelection.copyWith(
baseOffset: range.start, extentOffset: range.start);
} else {

View File

@@ -41,12 +41,12 @@ class DynamicsDataModel {
continue;
}
if (enableFilter &&
banWordForDyn.hasMatch(
item.orig?.modules.moduleDynamic?.major?.opus?.summary?.text ??
item.modules.moduleDynamic?.major?.opus?.summary?.text ??
item.orig?.modules.moduleDynamic?.desc?.text ??
item.modules.moduleDynamic?.desc?.text ??
'')) {
banWordForDyn.hasMatch((item.orig?.modules.moduleDynamic?.major
?.opus?.summary?.text ??
'') +
(item.modules.moduleDynamic?.major?.opus?.summary?.text ?? '') +
(item.orig?.modules.moduleDynamic?.desc?.text ?? '') +
(item.modules.moduleDynamic?.desc?.text ?? ''))) {
continue;
}
if (filterBan &&

View File

@@ -91,28 +91,30 @@ class _VotePanelState extends State<VotePanel> {
if (_enabled)
Padding(
padding: const EdgeInsets.only(top: 16),
child: OutlinedButton(
onPressed: groupValue.isNotEmpty
? () async {
final res = await widget.callback(
groupValue,
anonymity,
);
if (res.isSuccess) {
if (mounted) {
setState(() {
_enabled = false;
_showPercentage = true;
_voteInfo = res.data;
_percentage = _cnt2Percentage(_voteInfo.options);
});
child: Obx(
() => OutlinedButton(
onPressed: groupValue.isNotEmpty
? () async {
final res = await widget.callback(
groupValue,
anonymity,
);
if (res.isSuccess) {
if (mounted) {
setState(() {
_enabled = false;
_showPercentage = true;
_voteInfo = res.data;
_percentage = _cnt2Percentage(_voteInfo.options);
});
}
} else {
res.toast();
}
} else {
res.toast();
}
}
: null,
child: const Center(child: Text('投票')),
: null,
child: const Center(child: Text('投票')),
),
),
),
],