Added a toast notification for DB sigin

This commit is contained in:
xeovalyte 2024-03-12 15:51:23 +01:00
parent 57aa1a356c
commit 6098b7460b
No known key found for this signature in database

View File

@ -1,3 +1,4 @@
use crate::util;
use leptos::*; use leptos::*;
use leptos_use::{core::ConnectionReadyState, use_websocket, UseWebsocketReturn}; use leptos_use::{core::ConnectionReadyState, use_websocket, UseWebsocketReturn};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -158,6 +159,11 @@ fn surrealdb_response(response: String) {
/// Function to execute when DB signin is succesful /// Function to execute when DB signin is succesful
fn use_surrealdb(_response: SurrealResponse) { fn use_surrealdb(_response: SurrealResponse) {
util::toast::add_toast(
"Succesfully signed into DB".to_string(),
"success".to_string(),
);
let websocket = expect_context::<SurrealContext>(); let websocket = expect_context::<SurrealContext>();
websocket.set_authenticated.set(true); websocket.set_authenticated.set(true);