chore: Delete story only if can redact
This commit is contained in:
parent
5e9da22cf3
commit
3ac8973a9b
2 changed files with 10 additions and 5 deletions
|
|
@ -112,8 +112,8 @@ class SearchController extends State<Search> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
controller.text = VRouter.of(context).queryParameters['query'] ?? '';
|
|
||||||
WidgetsBinding.instance?.addPostFrameCallback((_) async {
|
WidgetsBinding.instance?.addPostFrameCallback((_) async {
|
||||||
|
controller.text = VRouter.of(context).queryParameters['query'] ?? '';
|
||||||
final server = await Store().getItem(_serverStoreNamespace) as String?;
|
final server = await Store().getItem(_serverStoreNamespace) as String?;
|
||||||
if (server?.isNotEmpty ?? false) {
|
if (server?.isNotEmpty ?? false) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
|
|
|
||||||
|
|
@ -87,10 +87,11 @@ class StoryView extends StatelessWidget {
|
||||||
child: PopupMenuButton<PopupStoryAction>(
|
child: PopupMenuButton<PopupStoryAction>(
|
||||||
onSelected: controller.onPopupStoryAction,
|
onSelected: controller.onPopupStoryAction,
|
||||||
itemBuilder: (context) => [
|
itemBuilder: (context) => [
|
||||||
PopupMenuItem(
|
if (controller.currentEvent?.canRedact ?? false)
|
||||||
value: PopupStoryAction.delete,
|
PopupMenuItem(
|
||||||
child: Text(L10n.of(context)!.delete),
|
value: PopupStoryAction.delete,
|
||||||
),
|
child: Text(L10n.of(context)!.delete),
|
||||||
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
value: PopupStoryAction.report,
|
value: PopupStoryAction.report,
|
||||||
child: Text(L10n.of(context)!.reportMessage),
|
child: Text(L10n.of(context)!.reportMessage),
|
||||||
|
|
@ -336,6 +337,10 @@ class StoryView extends StatelessWidget {
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: OutlinedButton.icon(
|
child: OutlinedButton.icon(
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surface,
|
||||||
|
),
|
||||||
onPressed: controller.displaySeenByUsers,
|
onPressed: controller.displaySeenByUsers,
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.visibility_outlined,
|
Icons.visibility_outlined,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue