-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report btn #241
Report btn #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit + minor change
src/utils/report.rs
Outdated
} | ||
|
||
impl ReportOption { | ||
pub fn as_str(&self) -> &'static str { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: impl Display makes more sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
facing issue when I am using it here with impl Display.
#[component]
pub fn SelectOption(is: &'static str, value: ReadSignal<String>) -> impl IntoView {
view! {
<option
value=is
selected=move || value() == is
>
{is}
</option>
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does #[prop(into)] is: String
work with display?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works
let off_chain_agent_url = OFF_CHAIN_AGENT_GRPC_URL.as_ref(); | ||
let channel = Channel::from_static(off_chain_agent_url).connect().await?; | ||
|
||
let mut off_chain_agent_grpc_auth_token = env::var("GRPC_AUTH_TOKEN").expect("GRPC_AUTH_TOKEN"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we migrate off chain client to AppState instead of constructing every time?
https://github.com/go-bazzinga/hot-or-not-web-leptos-ssr/blob/main/src/state/mod.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure running locally without off chain agent is possible
src/main.rs
Outdated
@@ -35,6 +37,8 @@ pub async fn server_fn_handler( | |||
provide_context(app_state.cookie_key.clone()); | |||
#[cfg(feature = "oauth-ssr")] | |||
provide_context(app_state.google_oauth.clone()); | |||
#[cfg(feature = "ssr")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be behind ga4
feature flag no?
main.rs already implies ssr
src/main.rs
Outdated
#[cfg(feature = "ssr")] | ||
use tonic::transport::Channel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually put these import inside the scope or use absolute imports so we don't add an extra #[cfg]
block
See https://github.com/go-bazzinga/hot-or-not-web-leptos-ssr/blob/main/src/main.rs#L113
@@ -28,5 +29,6 @@ pub mod server { | |||
pub cookie_key: Key, | |||
#[cfg(feature = "oauth-ssr")] | |||
pub google_oauth: openidconnect::core::CoreClient, | |||
pub grpc_offchain_channel: Channel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ga4
feature flag
} | ||
|
||
#[server] | ||
pub async fn send_report_offchain( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also add a mock (or make reporting no-op locally)
* report button * report btn * clippfy fixes * build fix * common client * common client in both * clippy fix * review changes * review changes
No description provided.