Skip to content

Commit

Permalink
Ogcfi ux daily: chat, apps enable on chat, clear chat function (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin authored Jan 4, 2025
2 parents 04f9d98 + 662bf12 commit c659e60
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 167 deletions.
2 changes: 1 addition & 1 deletion app/lib/backend/http/api/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Future<List<ServerMessage>> getMessagesServer({
Future<List<ServerMessage>> clearChatServer({String? pluginId}) async {
if (pluginId == 'no_selected') pluginId = null;
var response = await makeApiCall(
url: '${Env.apiBaseUrl}v1/messages?plugin_id=$pluginId',
url: '${Env.apiBaseUrl}v1/messages?plugin_id=${pluginId ?? ''}',
headers: {},
method: 'DELETE',
body: '',
Expand Down
85 changes: 43 additions & 42 deletions app/lib/pages/chat/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,48 +121,49 @@ class ChatPageState extends State<ChatPage> with AutomaticKeepAliveClientMixin {
),
),
)
: AnimatedMiniBanner(
showAppBar: _showDeleteOption,
height: 80,
child: Container(
width: double.infinity,
height: 40,
color: Theme.of(context).primaryColor,
child: Row(
children: [
const SizedBox(width: 20),
const Spacer(),
InkWell(
onTap: () async {
showDialog(
context: context,
builder: (ctx) {
return getDialog(context, () {
Navigator.of(context).pop();
}, () {
setState(() {
_showDeleteOption = false;
});
context.read<MessageProvider>().clearChat();
Navigator.of(context).pop();
}, "Clear Chat?",
"Are you sure you want to clear the chat? This action cannot be undone.");
},
);
},
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"Clear Chat \u{1F5D1}",
style: TextStyle(color: Colors.white, fontSize: 14),
),
),
),
const SizedBox(width: 20),
],
),
),
),
: null,
// AnimatedMiniBanner(
// showAppBar: _showDeleteOption,
// height: 80,
// child: Container(
// width: double.infinity,
// height: 40,
// color: Theme.of(context).primaryColor,
// child: Row(
// children: [
// const SizedBox(width: 20),
// const Spacer(),
// InkWell(
// onTap: () async {
// showDialog(
// context: context,
// builder: (ctx) {
// return getDialog(context, () {
// Navigator.of(context).pop();
// }, () {
// setState(() {
// _showDeleteOption = false;
// });
// context.read<MessageProvider>().clearChat();
// Navigator.of(context).pop();
// }, "Clear Chat?",
// "Are you sure you want to clear the chat? This action cannot be undone.");
// },
// );
// },
// child: const Padding(
// padding: EdgeInsets.all(8.0),
// child: Text(
// "Clear Chat \u{1F5D1}",
// style: TextStyle(color: Colors.white, fontSize: 14),
// ),
// ),
// ),
// const SizedBox(width: 20),
// ],
// ),
// ),
// ),
body: Stack(
children: [
Align(
Expand Down
Loading

0 comments on commit c659e60

Please sign in to comment.