misc passkey prep
This commit is contained in:
@@ -1,27 +1,36 @@
|
||||
use dioxus::prelude::*;
|
||||
use web_sys::{CredentialCreationOptions, window};
|
||||
|
||||
use crate::components::basic::Button;
|
||||
|
||||
#[component]
|
||||
pub fn PasskeyRegistrationButton() -> Element
|
||||
{
|
||||
pub fn PasskeyRegistrationButton() -> Element {
|
||||
rsx! {
|
||||
Button{
|
||||
text: "Register Passkey",
|
||||
onclick: move |e| {
|
||||
|
||||
onclick: move |_| {
|
||||
start_passkey_registration();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn start_passkey_registration() {}
|
||||
fn start_passkey_registration() {
|
||||
create_credential();
|
||||
}
|
||||
|
||||
fn create_credential() {}
|
||||
fn create_credential() {
|
||||
let credentials = window()
|
||||
.expect("Failed to get window")
|
||||
.navigator()
|
||||
.credentials();
|
||||
|
||||
let opts = CredentialCreationOptions::new();
|
||||
let _result = credentials.create_with_options(&opts);
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn PasskeyLoginButton() -> Element
|
||||
{
|
||||
pub fn PasskeyLoginButton() -> Element {
|
||||
rsx! {
|
||||
Button{
|
||||
text: "Login with Passkey"
|
||||
|
||||
@@ -29,7 +29,7 @@ pub fn Media(id: String) -> Element {
|
||||
#[component]
|
||||
fn MediaPage(media: MediaModel) -> Element {
|
||||
let url = media.thumb_url;
|
||||
let id = media.id.expect("Media has no id").value.clone();
|
||||
// let id = media.id.expect("Media has no id").value.clone();
|
||||
let cur_class = use_signal(|| match media.class {
|
||||
0 => "Standard",
|
||||
1 => "NSFW",
|
||||
|
||||
Reference in New Issue
Block a user